>>I may be way off the mark here because I've never used C18, however, these examples are either bad or wrong. >>In C, a "char" is a single character, and normally one byte. A string is an array of char . >>Therefore, >>const char str1 =3D "hello world"; >>is either illegal, or, depending on how the compiler handles it, might well be the same as saying >>const char str1 =3D 'h'; >>What you actually want to do is say:- >>const char[] str1 =3D "hello world"; Yes, just a typo mistake >>Additionally, >> >>const char * str3 =3D "hello world"; That's what I mean to say.... >>is also either illegal, or in some compilers will produce not quite the effect you're looking for. It would potentially create a char pointer, which is preconfigured to point to whatever value is represented by that string. In Win32, pointers are 32 bit, so that would (in visual c++) create a const char pointer that points to a memory address of "hell" (0x68656C6C), which is an Access Violation / Protection fault waiting to happen. Yes...=20 >>Additionally, remember that a "const char *" is a pointer whose value (ie what it points to) is fixed, however, you can (normally) write to the address pointed to by the pointer. eg:- >> >>const char * c =3D 0x70 >> >>*c =3D 'A' ; // valid-> 0x70 now contains 'A' >>c =3D &otherchar ; // invalid. c is const. Well, you are right. I didn't see that, while I actually know it.... Dammm! BUT, I did a test. My compiler says, after compiling that I'm using 168 bytes of RAM, so I comented a long list of strings (12 screens for a 20x4 display) defined like: const char * str3 =3D "hello world"; And nothing changed on the RAM area. Look at the compiler results..: With all the screens: Program ROM $000000 - $000003 $000004 ( 4) bytes=20 Program ROM $000008 - $000013 $00000C ( 12) bytes=20 Program ROM $000018 - $00006F $000058 ( 88) bytes=20 Program ROM $0000CA - $0005FD $000534 ( 1332) bytes=20 Program ROM $000D6C - $003B57 $002DEC ( 11756) bytes $003388 ( 13192) bytes total Program ROM RAM data $000092 - $0000FF $00006E ( 110) bytes=20 RAM data $0005CF - $0005FF $000031 ( 49) bytes $00009F ( 159) bytes total RAM data Near RAM $000000 - $000007 $000008 ( 8) bytes total Near RAM Near bits $000040 - $000043 $000004 ( 4) bits total Near bits =20 ROM data $000070 - $0000C8 $000059 ( 89) bytes=20 ROM data $000600 - $000D6A $00076B ( 1899) bytes =20 $0007C4 ( 1988) bytes total ROM data Program statistics: =20 Total ROM used 15180 bytes (46.3%)=20 Total RAM used 168 bytes (10.9%) =20 Near RAM used 9 bytes (7.0%)=20 Now, without the screens... (12 screens * 20 chars * 4 lines =3D 960 bytes) Memory Usage Map: =20 Program ROM $000000 - $000003 $000004 ( 4) bytes=20 Program ROM $00008 - $000013 $00000C ( 12) bytes=20 Program ROM $000018 - $00006F $000058 ( 88) bytes =20 Program ROM $0000CA - $0005FD $000534 ( 1332) bytes=20 Program ROM $000A02 - $0037ED $002DEC ( 11756) bytes $003388 ( 13192) bytes total Program ROM =20 RAM data $000092 - $0000FF $00006E ( 110) bytes=20 RAM data $0005CF - $0005FF $000031 ( 49) bytes $00009F ( 159) bytes total RAM data Near RAM $000000 - $000007 $000008 ( 8) bytes total Near RAM Near bits $000040 - $000043 $000004 ( 4) bits total Near bits =20 ROM data $000070 - $0000C8 $000059 ( 89) bytes=20 ROM data $000600 - $000A01 $000402 ( 1026) bytes =20 $00045B ( 1115) bytes total ROM data Program statistics: =20 Total ROM used 14307 bytes (43.7%)=20 Total RAM used 168 bytes (10.9%) =20 Near RAM used 9 bytes (7.0%)=20 So, as you can see ther is a difference (873 bytes, don=92t know where = are the other 87 bytes to complete the 12 screens...:( But the important thing is that the difference is on the ROM area and not in RAM... >>Hope that ramble helps :) Yes, it does... BST RGRDS Mauricio --=20 Outgoing mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.193 / Virus Database: 260.2.2 - Release Date: 27/10/2003 =20 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body