본문 바로가기

Study Meeting/빡공단 30기

[Day 4] Character variable : To represent a character type

In this class, I learned how to express single characters and strings, and received characters as char variables to express them as single characters and strings.

1. Two ways of expressing letters.
    1) Constant: String constant (fixed string value)
    2) Variables: Used when you want to change the value during execution

2. Characteristics of Character Variables
    1) Character variables use char type
    2) 1 English letter requires 1 byte space (2 bytes for Korean)
    3) The end of the string contains NULL characters (to signal the end of the string)

 

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
    char A;
    A = 'A';
    
    printf("%c", A);
    
    return 0;
}