+ 1

Can i give an integer value to a 'char' variable in C language? Ex- char a = 4;

11th Feb 2017, 2:56 PM
Resurektzz7
Resurektzz7 - avatar
3 Respuestas
+ 7
As a matter of fact, you can, but: The char variable will store the corresponding character of the ASCII integer value. The integer value itself will not be stored. E.g. char a = 59; cout << a; // outputs ;
11th Feb 2017, 3:02 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
yes you can assign integer value to char variable but on printing that variable you will be able to see ascii code corresponding to the value assigned to the variable
11th Feb 2017, 3:11 PM
Ambika Arora
Ambika Arora - avatar