Convert from int to char in C

0

My question is about how to convert from int to char in C language. It's the equivalent to doing in C #:

int a = 97;
char b = (char)a;
Console.WriteLine(b);
    
asked by livi.glez 09.10.2018 в 23:43
source

1 answer

1

It is very similar to your example, in fact in c the data type char is a numeric value, you can see it in the following example:

int a = 97;
char b = (char)a;
printf("%c", a);

The result will be "a" as in your example.

    
answered by 12.10.2018 в 00:14