+ 1
Can i give an integer value to a 'char' variable in C language? Ex- char a = 4;
3 odpowiedzi
+ 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 ;
+ 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