Friday, January 20, 2012

In c++, what is the difference between single and double quotation marks?

usually the ' is for type char and " is for type string. if ch is char in your example you get an error because "Q" is different in type from 'Q'. 'Q' is a char so if char(ch)==char is evaluated but "Q" is string and char(ch)==string returns an error (invalid type).

No comments:

Post a Comment