What is the difference between cout<<"hello" and cout<<'hello'? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the difference between cout<<"hello" and cout<<'hello'?

9th Jul 2018, 10:27 AM
Bill Elim
Bill Elim - avatar
6 Answers
+ 2
single character vs string litetal 🤔
9th Jul 2018, 10:36 AM
\__(° = °)__/
+ 1
"hello" is const char* type. 'a' is char But 'hello' is INT. Multiple characters in two single questions is INT type.
9th Jul 2018, 11:19 AM
Disvolviĝo;
Disvolviĝo; - avatar
+ 1
' ' is for char. " " is for string.
11th Jul 2018, 6:59 AM
Champ BIT
Champ BIT - avatar
+ 1
'hello' evaluates to an int based on the first 4 characters (Which become its bytes). Its actually not a string at all. "hello", however is a string.
14th Jul 2018, 1:32 AM
Blake Quake
Blake Quake - avatar
0
a is String and another is Character type
16th Jul 2018, 1:19 AM
hai zhou
hai zhou - avatar
0
' ' prints the statement inside it .. " " searches for the variable inside the double quotes
24th Jul 2018, 5:57 AM
Manish Sãíñì
Manish Sãíñì - avatar