데이터타입에 대한 겅부2 - 그것에대한 scanf

#include <stdio.h>

int main(void)
{

int _int;
unsigned int _unsignedInt;
long _long;
unsigned long _unsignedLong;
short _short;
char _char;
char _charArray[10];
float _float;
double _double;
long double _longDouble;

    
    printf("_char = ");
    scanf("%c", &_char);
    printf("_char = %c\n", _char);

    printf("_charArray = ");
    scanf("%s", _charArray);
    printf("_charArray = %s\n", _charArray);


    printf("_int = ");
    scanf("%d", &_int);
    printf("_int = %d\n", _int);

    printf("_unsignedInt = ");
    scanf("%u", &_unsignedInt);
    printf("_unsignedInt = %u\n", _unsignedInt);

    printf("_long = ");
    scanf("%ld", &_long);
    printf("_long = %ld\n", _long);

    printf("_unsignedLong = ");
    scanf("%lu", &_unsignedLong);
    printf("_unsignedLong = %lu\n", _unsignedLong);

    printf("_short = ");
    scanf("%hd", &_short);
    printf("_short = %hd\n", _short);
    printf("_float = ");
    scanf("%f", &_float);
    printf("_float = %f\n", _float);

    printf("_double = ");
    scanf("%lf", &_double);
    printf("_double = %lf\n", _double);

    printf("_longDouble = ");
    scanf("%Lf", &_longDouble);
    printf("_longDouble = %Lf\n", _longDouble);

return 0;
}


+ Recent posts