0

What is the difference ??

between ' ' & " " also between = & == and what is the meaning of " " having a space between the quotation ??

8th Nov 2016, 7:35 PM
Shaloke Chakraborty
Shaloke Chakraborty - avatar
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 }
8th Nov 2016, 7:41 PM
Cohen Creber
Cohen Creber - avatar
+ 1
A string is a sentence, basically. Just a long "string" of characters. Anything longer than one character, you'd use a string.
8th Nov 2016, 7:46 PM
Cohen Creber
Cohen Creber - avatar
+ 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.
8th Nov 2016, 7:52 PM
Cohen Creber
Cohen Creber - avatar
+ 1
oh.. thanks !! :)
8th Nov 2016, 8:04 PM
Shaloke Chakraborty
Shaloke Chakraborty - avatar
0
what is string ??
8th Nov 2016, 7:43 PM
Shaloke Chakraborty
Shaloke Chakraborty - avatar
0
ohkk... any answer for my third question ??
8th Nov 2016, 7:49 PM
Shaloke Chakraborty
Shaloke Chakraborty - avatar