#include <stdio.h>

int main() {
    // 문자 char : 한 글자를 나타내는 자료형 ''
    char a = 'C';
    printf("저장된 문자 : %c\n", a);

    // 문자열 string : 여러 글자를 나타내는 자료형 ""
    char b[10] = "apple";
    printf("저장된 문자열 : %s\n", b);
    // 문자열의 가장 마지막에는 널null문자 \0이 들어있다
    printf("%ld\n", sizeof(b));

    printf("----문제----\n");
    char r;
    scanf("%c", &r);
    printf("%c\n", r);

    printf("----숙제----\n");
    char h[6] = "hello";
    printf("%s\n", h);


    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: