We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
xdata struct EEPROM {
unsigned int Last_Data; struct EEPROM *Node; };
struct EEPROM xdata * xdata p; p = (struct EEPROM xdata *)0x0FF6; if i will print the following statement printf("Size of p = %d",(unsigned int)sizeof(*p));
then it will shows the 5,but actually it should show the 4 bytes
It would help if you formatted you code legibly - see http://www.keil.com/forum/tips.asp
xdata struct EEPROM { unsigned int Last_Data; // 2 bytes struct EEPROM *Node; // 3 bytes (Generic pointer) };
So the toal should be 5!
Why did you think 4?
Hm ... I can only guess.
I can also guess that the next question will be about some dynamic memory allocation/deallocation issue. Anyone want to bet ?