On Sun, Feb 12, 2006 at 05:11:07PM -0500, Sean wrote: > > char * const test5p = "test 5 pointer"; // .rodata > test5p[0] = 'o'; // .rodata; ok **** > Except for test5p -- it's mapped to .rodata yet the compiler allows me to > try to change it, while it won't let me change test5b?? the pointer variable test5p is mapped to .rodata, but what it points to is not. Your assignment is not changing test5p, just the contents of the memory that it points to, which is a string literal, with a type of "char *", NOT "const char *". In the case of: > char const test5b[] = "test 5 bracket" there is no pointer, just an array with an initializer. Clyde -- Clyde Stubbs | HI-TECH Software Email: clyde@... | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@... | AUS: +61 7 3722 7777 +61 7 3722 7778 --------------------------------------------------------------------------- HI-TECH C: compiling the real world.
Message
Re: [lpc2000] Re: gnuarm question
2006-02-12 by Clyde Stubbs
Attachments
- No local attachments were found for this message.