Can somebody distinguish for me character constant and string constant giving examples
Can somebody distinguish for me character constant and string constant giving examples
Sure. I guess you mean "literal" when you say "constant".
A character literal is a single character( or more for escape sequences ) surrounded by single quotes, like this:
A string literal is a sequence of characters( including blanks ) surrounded by double quotes, like this:Code:'x' // The character 'x' '\n' // The newline character
Code:"This is a string"
Devoted my life to programming...