answersLogoWhite

0


Best Answer

A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between a C plus plus string and a C-style string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the role of plus operator between two string constant?

The plus operator between string constants allows string concatination: string a = "Hello, "; string b = "World!"; string c = a + b; The output of c would be: "Hello, World!".


What is the difference between n and endl in c plus plus?

The \n escape sequence simply inserts a newline within a string. std:endl does the same but also flushes the write buffer.


What is the difference between private stafford and plus student loans?

What is the difference between private stafford and plus student loans?


How can you get a specific string from large string using c plus plus strings?

std::string::substr();


What is the difference between pointers in c and c plus plus?

Nothing.


What is the difference between be plus ing and get plus ing?

There are no such terms in C++.


Changing a word to all uppercase letters in c plus plus?

To change any string to uppercase, loop through each character in the string. If the character is in the range 'a' through 'z', decrement the character by decimal 32 (the difference between ASCII value 'a' and 'A'). The following function shows an example of this: void to_upper(std::string& str) { for(int i=0; i<str.size(); ++i) if(str[i]>='a' && str[i]<='z') str[i]-=32; }


What is the difference between statements in c plus plus charconstp and char constp?

There is no difference. Both statements are invalid.


What is the difference between Nike plus and Nike plus Active?

They have different names


What is the difference between plus 8 and -12?

-4


What is the difference between DVD plus r and DVD plus rw?

rightable and rewightable


Difference between void and devoid in c plus plus?

There is no such thing as devoid in C++.