본문 바로가기

Study Meeting/빡공단 30기

[Day 6] ASCII Code: How to represent letter in C Language?

In this class, I learned about how to represent the letter in the C language.
ASCII code is a representation method for expressing the letter with a form of number.
For example, capital "A" is exchanged as 65, and "a" is exchanged as 97.
Therefore, if you write a code as "printf("%c", a)", computer input a number 97, not a letter 'a'.

To find a specific letter, look for the letters in the link below.
https://www.ascii-code.com/

 

Here's a example code for understanding how the ASCII code is running in the C programming.

#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[]) {
    
    printf("%d", a);
    
    return 0;
}

Results showed that letter "a" has a 97 that denoted as the ASCII code.