|
From: Per W. <pw...@ia...> - 2005-05-17 23:41:56
|
p would have to be char* since it must be changed to point at different locations. char p[] is a fixed array that can't be moved. /Per W On Tue, 17 May 2005, Guillermo Gutierrez wrote: > 'p' would be a char* then? or a char p[]? > > -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Tuesday, May 17, 2005 4:30 PM > To: Guillermo Gutierrez > Cc: dev...@li... > Subject: RE: FW: [Dev-C++] Win32 Shell API > > > That is your problem. > > You simply can not use strcat to concatenate a "\0" since it breaks at the > \0 in the string. > > p = SrcPath; > strcpy(p,LP4); > p += strlen(p)+1; // skip # of inserted chars + the '\0'; > strcpy(p,SFA); > p += strlen(p)+1; // "- > strcpy(p,""); // just writes the final '\0' > > And of course, you can not use std::cout to emit a char* or char[] that > contains '\0' in the middle... > > /Per W |