Difference between ' and "
Solved
stell-91
Posted messages
519
Registration date
Status
Member
Last intervention
-
Dalfab Posted messages 638 Registration date Status Member Last intervention -
Dalfab Posted messages 638 Registration date Status Member Last intervention -
Hello,
I'm having a bit of trouble with programming because I think I don't understand the difference between " and '.
If I understand correctly, in a program when I do "x" it will display the character x as output.
But if I do 'x' what is the difference? Why use 'x'?
Thank you for your explanations
Configuration: Windows / Chrome 59.0.3071.115
I'm having a bit of trouble with programming because I think I don't understand the difference between " and '.
If I understand correctly, in a program when I do "x" it will display the character x as output.
But if I do 'x' what is the difference? Why use 'x'?
Thank you for your explanations
Configuration: Windows / Chrome 59.0.3071.115
1 answer
-
Hello stell-91,
Single quotes are for characters while double quotes are for strings.
For example, you cannot write in C:
'string' but you can write "string".
In fact, the character corresponding to an integer in the ASCII table is a character, while the other is an array made up of characters.
Did you come from a high-level language like PHP, Python, Ruby, or another?