+ 1
Is every character a string
7 Antworten
+ 1
every string is the array of characters
+ 1
every character is not string
every string is of several char and a extra character null \0
+ 1
Hi there! A string is a sequence of chars (be it that you define char via char array or by using the class std::string).
This means that you can have a char expressed as a char variable that can only hold exactly one char or as string that only contains one char. Even though both variants only hold a single char, conceptually, one is a char and the other is a string.
A code example:
#include <string>
…
char c = 'a';
std::string s = "b";
std::string s2 = "cdefg";
char c can only hold one character "a" and has to be wrapped in '. string s also only has one character but as this is a string it has to be wrapped in ". string s2 really shows that strings can hold more that just one char, if you want it to.
0
No.
0
no string is a group of characters but a character is can be a number or letter
0
nopes
0
No every string must have more than one character. the character may be a-z or A-Z or numbers or special symbols..
Note: character are only one byte and representation is within single quote
where as
string in c++ is object which size can be found using string.size() member function
it represent in double quotes