c,

[C] Hello World

Software-engineer Software-engineer Follow Dec 02, 2020 · 1 min read
[C] Hello World
Share this

The first thing you do learning a programming language is to print Hello World. It is a representative learning stage so ther is a HelloWorld series for each programming language. The reason people first introduce and learn the Hello World output is because it’s the simplest way to show that the code works fine.

프로그래밍 언어를 배울때 가장 먼저 해 보는 것은 Hello World를 출력하는 것이다. 이 단계는 각 언어별 Hello World 시리즈가 있을 정도로 대표적인 학습단계이다. Hellow World 출력을 맨 먼저 소개하고 학습하는 이유는 작성한 코드가 정상적으로 동작함을 보여주는 가장 간단한 방법이기 때문이다.

    #include <stdio.h>

    int main(void){
        printf("Hello World");  

        return 0;
    }
                

Looking at the code for displaying Hello world, stdio.h is declared with #include in the first line. A header file with the .h extension can be easily understood if you think of it as a source code file to use by writing a function in advance. The printf function is a standard library that exists in the stdio.h header file. Therefore, when using printf, always declare stdio.h file at the beginning.
(Such as stdio.h file are automatically provided by the compiler every time)

Hello world를 출력하기 위한 코드를 살펴보면 맨 첫 줄에 stdio.h#include와 함께 선언되었다. .h 확장자를 가지는 헤더파일은 미리 함수를 작성하여 사용하는 소스코드 파일이라고 생각하면 쉽게 이해할 수 있다. printf 함수의 경우 stdio.h 헤더파일에 존재하는 표준 라이브러리이다. 따라서 printf를 사용할 때에는 항상 stdio.h 파일을 서두에 선언해야한다.
(매번 작성하지 않아도 stdio.h와 같은 파일들은 컴파일러에 의해 자동으로 제공된다)

Software-engineer
Written by Software-engineer
Software engineer Youn