0
What is the difference ??
between ' ' & " " also between = & == and what is the meaning of " " having a space between the quotation ??
6 ответов
+ 3
' ' single quotations are used for characters.
char c = 'a';
" " double quotions are used for strings.
string str = "Hello";
= is the assignment operator, for giving a variable a value.
int x = 5;
x = 10;
== is the comparison operator, for comparing values.
int x = 5;
if (x == 5)
{
//code
}
+ 1
A string is a sentence, basically. Just a long "string" of characters. Anything longer than one character, you'd use a string.
+ 1
A space in between double quotations is treated just like any other character, as a space IS a character, just without any visuals.
string str = " Hello There ";
cout << str;
This will print the string exactly as it is shown, because a space is nothing more than a character, like any other.
+ 1
oh.. thanks !! :)
0
what is string ??
0
ohkk... any answer for my third question ??