hi Everybody, i copy and paste a line of code bellow as an example:
"#define USB (( USB_TypeDef *) USB_BASE)"
( suppose #define USB_BASE 0x0C000 )
i don't understand the "(( USB_TypeDef *) USB_BASE)"? why the *, the pointer operator, is placed with type inside parenthesis?
thanks, Ras
Per Westermark!
thank you very much.
" The first is a type cast - telling the compiler to treat an integer as a pointer to a sepcific data type.
The second is a variable declaration. Telling the compiler to allocate the memory for a single variable USB_BASE that is of type "Pointer to USB_TypeDef"."
these solved my problem; type casting.
( i am learning c programming language within my embedded projects. )
with the best regards,
Rasool