In C, data type of character constants is int, but in C++, data type of same is char.
If we save below program as test.c then we get 4 as output (assuming size of integer is 4 bytes) and if we save the same program as test.cpp then we get 1(assuming size of char is 1 byte)
- Type difference of character literals in C and C++
- Bool data type in C++
- What is data type of FILE in C ?
- Is there any need of "long" data type in C and C++?
- What is the size_t data type in C?
- C++ map having key as a user define data type
- Data Type Ranges and their macros in C++
- C++ set for user define data type
- Multi-set for user defined data type
- Comparison of boolean data type in C++ and Java
- Data type of case labels of switch statement in C++?
- Conversion of Struct data type to Hex String and vice versa
- Constants in C
- Constants vs Variables in C language
- Check input character is alphabet, digit or special character