Sorry, I went off half-cocked. That's what happens when you type before your first cup of coffee. You're absolutely right, and I stand corrected. Thanks. Friends don't let friends type without thinking. -----Original Message----- From: Bob Ammerman [mailto:RAMMERMAN@PRODIGY.NET] Sent: Friday, October 13, 2000 8:42 am To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: C compilers char string[10]; string = "Hello"; > C++ may understand that line, but normal C will not. If you want to copy a > string, you need to use the strcpy function (the prototype will be found in > string.h). No: "C++" will _not_ understand it either. C++ handles char arrays the same as C does. C++ does have a string class, which you would use like this: string mystring; mystring = "Hello"; Note that 'string' is the data type of 'mystring'. > The line you wrote will probably just > assign a pointer to string to point into ROM, leaving the original 10 bytes > reserved for string lost. No: 'string' is an array reference, which is, in most contexts, treated as a constant pointer (ie: one which cannot be changed). The compiler should generate an error on the assignment. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu WABTEC CORPORATION CONFIDENTIALITY NOTE The content contained in this e-mail transmission is legally privileged and confidential information intended only for the use of the individual or entity named herein. If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this transmission is strictly prohibited. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu