(single quotes & double quotes)'s difference in C++
Single quotes ----- characters --- actually represent an integer
Double quotes ----- string -- is a pointer to the starting character of the unnamed array ------ end with '/0'
Code 1:
int main(){
string s1;
s1 = 'hello';
cout<<s1<<endl;
return 0;
}
output:
o
Code 2:
int main(){
string s1;
s1 = “hello”;
cout<<s1<<endl;
return 0;
}
output:
hello