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.
Hi
Why does this declaration not work: char xdata *pointer _at_ postion;
but this one works: char xdata array[1] _at_ postion;
Should be theoretically the same, or not?
Thanks Egon
I'm sure someone here could give you specific references to manuals, but you should consider how the compiler treats each.
For simplicity, ignore the '_at' portion.
char xdata *pointer is allocating space for a pointer, the location of the pointer is at a specific location, but the value of which is variable (i.e., non constant).
char xdata array[1] is allocating space for a single byte of memory at a specific location (i.e., the location is constant).
So, clearly, they are not the same.
My problem is I have to place the pointer at a specific location, hence the _at_ keyword. The pointed address is not the question here!
Then try:
xdata char *pointer _at_ location;
Just tried it here, works as I would expect.
"My problem is I have to place the pointer at a specific location"
What is it, exactly, that compels you to do that?
If this is not a real requirement, then why make life difficult for yourself?!