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;
}
'Study Meeting > 빡공단 30기' 카테고리의 다른 글
[Day 6] ASCII Code: How to represent letter in C Language? (1) | 2023.01.07 |
---|---|
[Day 5] Standard input/output functions: scanf() and printf() (0) | 2023.01.05 |
[Day 3] Numeric variables : To represent a number type (0) | 2023.01.03 |
[Day 2] Output function in C language: printf() (0) | 2023.01.02 |
[Day 1] Print "Hello C World" for confirming the IDE settings (0) | 2023.01.01 |