Any character with in single quotes('a') is a character literal (character constant) and a string literal is a set of characters with in double quotes ("Hello").
And if we have multiple characters in side single quote('aa') ,it is a multi-character literal
Before going to the multi-character literal we will check how these literals are considered (as value and type) by compiler. In C language type of character literal is int. So size of char literal is 4 bytes in 32 bit architecture. Where as in C++ the type of character literal is char and size is 1 byte.
Save following program with .c and .cpp extension and run with c and cpp compiler.
And if we have multiple characters in side single quote('aa') ,it is a multi-character literal
Before going to the multi-character literal we will check how these literals are considered (as value and type) by compiler. In C language type of character literal is int. So size of char literal is 4 bytes in 32 bit architecture. Where as in C++ the type of character literal is char and size is 1 byte.
Save following program with .c and .cpp extension and run with c and cpp compiler.