Assign char type to a variable and output as integer - C Data Type

C examples for Data Type:char

Description

Assign char type to a variable and output as integer

Demo Code

#include<stdio.h>

int main (void)
{
    char c, d;//from ww  w .j a  va 2s.  c  om

    c = 'd';
    d = c;
    printf ("d = %c\n", d);

    return 0;
}

Result


Related Tutorials