Single quotes and Double quotes 'a' and ''a'' in C++
What is basic difference between the single quotes ('a') and the double (''a") , that we usually use in c++ and gets confused between these two.
So the characters which are enclosed in the single qoutes are character constants in C++.Thus 'a' is a character constant.The chraracter enclosed in double quotes sre basiclly string literals which are array of characters.Thus "a" is a string and size of the 'a' is 1 character whereas the size of the "a" is 2 characters.
No comments:
Post a Comment