PDA

View Full Version : C syntax


swraman
04-02-2010, 09:32 PM
Hi,

Im working on a project for a class and It looks like C may be the only way to implement it.

Im looking through a library for my microcontroller, and one line confuses me:

#define VARIABLENAME (*((volatile unsigned long *)0x40048000))

Im not farmiliar with C, having only had one lecture on it, and I dont know what the "*)" part of the code means. CAn someone break that line down for me a little bit please? my best guess is that it sets VARIABLENAME to a handle for the memory adress that has been casted as a long. Is this correct?

So the memory references for my microcontroller are stored as longs?

thanks

drhowarddrfine
04-03-2010, 01:34 AM
0x40048000 is a pointer to an unsigned long which is a pointer.