|
-
Nov 25th, 2000, 02:55 PM
#1
Thread Starter
Frenzied Member
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]
-
Nov 25th, 2000, 03:04 PM
#2
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 25th, 2000, 03:11 PM
#3
Thread Starter
Frenzied Member
-
Nov 25th, 2000, 03:21 PM
#4
Monday Morning Lunatic
Er...that's very different.
Use the string class from the STL.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|