Are there any advantages that C strings have over C++ strings?
C doesn't have strings. It has arrays of characters and all the null pointers, memory leaks, and buffer overflows that go along with that.Are there any advantages that C strings have over C++ strings?
Assuming by "C string" you mean nul-terminated arrays of char values, then the advantage is performance, both in terms of memory and speed. There are a lot of disadvantages, too. So it all depends on what is important to you.Are there any advantages that C strings have over C++ strings?
Then why mention "C"?I think he's asking the difference between the "CString" class:
https://msdn.microsoft.com/en-us/library/aa300688(v=vs.60).aspx
and the "String" class:
https://msdn.microsoft.com/en-us/library/system.string(v=vs.113).aspx
I was thinking he was confused and got "C" from the class name "CString".Then why mention "C"?
Well, he never came back to get his answer (or to thank us for our efforts). I suppose it wasn't all that important.I was thinking he was confused and got "C" from the class name "CString".