+ 1

Is every character a string

16th Jun 2016, 9:22 AM
Nisarg Uchiha
Nisarg Uchiha - avatar
7 Antworten
+ 1
every string is the array of characters
16th Jun 2016, 9:57 AM
Sardor
Sardor - avatar
+ 1
every character is not string every string is of several char and a extra character null \0
16th Jun 2016, 10:26 AM
DJ Shiva & DJ Baba Shiv-Shekhar
DJ Shiva & DJ Baba Shiv-Shekhar - avatar
+ 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.
16th Jun 2016, 10:35 AM
Stefan
Stefan - avatar
0
No.
16th Jun 2016, 8:10 PM
VPA
VPA - avatar
0
no string is a group of characters but a character is can be a number or letter
18th Jun 2016, 2:26 PM
raees
0
nopes
19th Jun 2016, 7:05 PM
Iman Ali
Iman Ali - avatar
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
23rd Jun 2016, 7:08 PM
Zuber Ahmed
Zuber Ahmed - avatar