C Language Learning Notes: 1. Hello World

The course referenced in these notes is Frank’s C language course reset in 2024:

C Language Master: Coding Crazy, Criticizing Loudly (Part 1) Bilibili[1]

C Language Master: Coding Crazy, Criticizing Loudly (Part 2) Bilibili[2]

Although I have previously taken C language courses and have some understanding of C, I sometimes feel that I have a superficial grasp of certain concepts. Without a systematic set of notes, I often find myself confused about many topics, and after some time, I might forget them. Therefore, I plan to start learning C language systematically from the first step, Hello World, and create organized notes.

It is worth mentioning that these notes do not aim to transcribe everything Frank teaches, as that would be too much work and not very meaningful. Instead, the notes mainly cover concepts that I find unclear or noteworthy, making it easier for future reference.

If these notes happen to help you, I am very happy!

1. The First Program

// # Similar to a key
// include includes
// stdio standard input/output
// .h header file
#include <stdio.h>

// int returns an int type
// main main function
// void no input
int main(void)
{
    // printf formatted print
    // \n newline
    printf("Hello World!\n");

    // end, return value 0
    return 0;
}

The C language is a procedural language, and programs execute sequentially from top to bottom.

2. Basic Terminology

Preprocessor instruction

Function, functionality (functions), generally, a program has and can only have one<span>main()</span> function

Statement (statements), an instruction/process/operation

Declaration

Definition

Initialization

Assignment

Null statement (null statements), for example, a statement that consists of only a<span>;</span>

3. Official Microsoft C Language Documentation

Reference:C Documentation – Introduction, Tutorials, Reference. | Microsoft Learn[3]

4. Elements of C Language (Elements of C | Microsoft Learn[4])

5.1 Tokens

In C source programs, the basic elements recognized by the compiler are “tokens”. Tokens are the source program text that the compiler does not break down into component elements.

C Tokens | Microsoft Learn[5]

5.2 Keywords

“Keywords” are words that have special meanings to the C compiler.

C Keywords | Microsoft Learn[6]

5.3 Identifiers

“Identifiers” or “symbols” are the names you provide for variables, types, functions, and labels in your program. Identifier names must differ in spelling and case from any keywords. Keywords (C or Microsoft) cannot be used as identifiers; they are reserved for special purposes. Identifiers are created by specifying them in the declaration of a variable, type, or function.

C Identifiers | Microsoft Learn[7]

Reference Links

<span>[1]</span> C Language Master: Coding Crazy, Criticizing Loudly (Part 1) Bilibili: https://www.bilibili.com/video/BV1Ae41117Gd<span>[2]</span> C Language Master: Coding Crazy, Criticizing Loudly (Part 2) Bilibili: https://www.bilibili.com/video/BV1oJ4m1Y7ry<span>[3]</span> C Documentation – Introduction, Tutorials, Reference. | Microsoft Learn: https://learn.microsoft.com/zh-cn/cpp/c-language<span>[4]</span> Elements of C | Microsoft Learn: https://learn.microsoft.com/zh-cn/cpp/c-language/elements-of-c<span>[5]</span> C Tokens | Microsoft Learn: https://learn.microsoft.com/zh-cn/cpp/c-language/c-tokens<span>[6]</span> C Keywords | Microsoft Learn: https://learn.microsoft.com/zh-cn/cpp/c-language/c-keywords<span>[7]</span> C Identifiers | Microsoft Learn: https://learn.microsoft.com/zh-cn/cpp/c-language/c-identifiers

Leave a Comment