PDA

Click to See Complete Forum and Search --> : Loads Of things


PsyVision
Nov 25th, 2000, 01:55 PM
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]

parksie
Nov 25th, 2000, 02:04 PM
char *name is only a pointer. To use it, you need to do something like:

char *name = "Darren"

However, you can't then change it, so you'd need something like:

char *darren = "Darren";
char *name = new char[strlen(darren)+1];

strcpy(name,darren);

then you can alter name as much as you want.

PsyVision
Nov 25th, 2000, 02:11 PM
What about BSTR ?

parksie
Nov 25th, 2000, 02:21 PM
Er...that's very different.

Use the string class from the STL.