On Mon, 27 Oct 2003, Hulatt, Jon wrote: > const char[] str1 = "hello world"; > > This will create str1 as a pointer to the first element of an array > preinitialised to contain that string, and null terminated. This creates a const array, not a pointer. > const char * str3 = "hello world"; > > is also either illegal, or in some compilers will produce not quite the > effect you're looking for. That is perfectly legal code. It creates a pointer to the string "hello world". The only thing in the above code that might depend on the compiler is whether "hello world" is in ROM or RAM. > It would potentially create a char pointer, which > is preconfigured to point to whatever value is represented by that string. It points to the string, not the "value 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. I don't have access to VC++, but I think if you tried the above code you would find it does nothing of the sort. -- John W. Temples, III -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body