S
shalakasan
Hi,
I am creating a pointer to char:
char * lDirName = new char;
I am trying to set values character by character.
lDirName[0]= 'c';
lDirName[1]= ':';
lDirName[2]= '\\';
The problem is that, the memory address that "lDirName " is pointing to
has some junk value in it. so instead of "lDirName" taking value as
"c:\" it takes value as "c:\1" or anything that is there in the memory.
I can't use static array because I don't know how long "lDirName "
going to be.
how to overcome this problem?
Best Regards,
Shal
I am creating a pointer to char:
char * lDirName = new char;
I am trying to set values character by character.
lDirName[0]= 'c';
lDirName[1]= ':';
lDirName[2]= '\\';
The problem is that, the memory address that "lDirName " is pointing to
has some junk value in it. so instead of "lDirName" taking value as
"c:\" it takes value as "c:\1" or anything that is there in the memory.
I can't use static array because I don't know how long "lDirName "
going to be.
how to overcome this problem?
Best Regards,
Shal