PDA

Click to See Complete Forum and Search --> : Strings


tbarnette
Jul 2nd, 2002, 07:47 AM
'Mornin folks.

I just read another thread about comparing two strings. I haven't used C since MS VC 1.51. I dont recall a string type. Is this something new? Will it work like other languages? Does it no longer need a null terminator?

HarryW
Jul 2nd, 2002, 08:55 AM
There is a standard string class in C++. It's in the std namespace. There's no string class in C, obviously.

parksie
Jul 2nd, 2002, 11:30 AM
As far as null terminators go...

...no, they don't need one any more, since the strings are stored by length (also making asking for the length a fast operation).

Unfortunately, I think there are situations when you use .c_str() to get a const char* pointer to the content of a string...when I get home and have access to a compiler (a good one, the ones at work are x centuries out of date) I'll check it out for you.