What is the difference between 0 and "0"? I don't even think there IS any. Such as, if we declare a variable's data to 0, it still works, as variables don't allow numbers in their names. So even if we consider it a string literal, will it even be DIFFERENT? I have got no idea. Thanks
I do think there is a difference, the difference is in the datatype.
(Someone please correct me if I got this wrong)
1 2 3
0 //this is a constant int
"0" //this is a constant string
'0' //this is a constant char
I would suggest you don't start forming opinions on what you think "is" or "isn't" until you have a better grasp of the language.
Some things in programming may seem illogical from a human perspective, but when seen from the computers perspective (in 1's and 0's) it usually makes sense.
A big difference. 0 is a constant signed integral literal. "0" is a pointer to a constant character (const char *). The difference here is that "0" has an address, whereas 0 does not. As a result, unless a string is placed at the memory location 0x0, 0 and "0" will never be equal.
It's actually treated as a char by the language. Of course you can assign it to an integer, but for purposes of type identification, '0' is a char, not an int.