The char
data type can store numbers, characters, and symbols, so what is the need for the int
data type?
char = '2';
I have knowledge of use of int
, but I want to know the conceptual part to describe it fundamentally.
The char
data type can store numbers, characters, and symbols, so what is the need for the int
data type?
char = '2';
I have knowledge of use of int
, but I want to know the conceptual part to describe it fundamentally.
Usually, int
can hold larger numbers than char
. In current, widely available architectures, int
is 32-bit, while char
is 8-bit. Furthermore, it is implementation defined that a char
is signed or unsigned.
On these architectures int
can hold numbers between -2147483648 and 2147483647, while a (signed) char
can hold numbers between -128 and 127.