-
Hi,
Dumn old me, serveral qs here:
In C++ will
char* Name;
be able to hold the string "darren" of does this only store one char.
What are the c++ equivelants to these:
split()
Collection
Instr()
Left()
Right()
Mid()
Many thanks.
[Edited by PsyVision on 11-25-2000 at 03:00 PM]
-
char *name is only a pointer. To use it, you need to do something like:
Code:
char *name = "Darren"
However, you can't then change it, so you'd need something like:
Code:
char *darren = "Darren";
char *name = new char[strlen(darren)+1];
strcpy(name,darren);
then you can alter name as much as you want.
-
-
Er...that's very different.
Use the string class from the STL.