Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/25/03 00:03
Read: times


 
#37220 - RE: DATA to XDATA problem
"U8 *au8Array;" defined a pointer but did not initialize it and did not allocate an array for it to point to. if you tried to use this pointer without pointing it to some allocated memory you would be in trouble (it could point to anywhere in internal RAM, including the current register bank; you can easily corrupt your processor state by writing to uninitialized pointers).

"U8 au8Array[x];" defined an array and allocated space for it.

you could use the first form, as long as you used malloc() to allocate the data it points to, or point to data allocated some other way (by definition in a C file or an ASM file). i don't know if 8051 compilers have malloc(), though.

james


List of 12 messages in thread
TopicAuthorDate
DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      
RE: DATA to XDATA problem            01/01/70 00:00      

Back to Subject List