'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?
Printable View
'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?
There is a standard string class in C++. It's in the std namespace. There's no string class in C, obviously.
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.