Antonin Hérault
Antonin Hérault

Antonin Hérault

Introduction to the C language (1)

Antonin Hérault's photo
Antonin Hérault
·Jul 10, 2022·

3 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • Discover your new best friend
  • Hello World !
  • Compiler installation
  • Common confusions

Welcome to the C course for beginners and advanced programmers ! This course is gonna be the more complete as possible, with tutorials, some exercises and a long trip to explore the C standard library.

If you wanna give any review or ask for things to be added to this course, don't hesitate to post a comment under this course's posts.

Discover your new best friend

The C programming language was created in the 1970s by Dennis Ritchie.

It's the successor of the B language. Got this ? We walked through the Latin alphabet letters until we finally made a good language for everyone. Then, derived languages born like C++.

Does the D language exist ?

Yes, it is. But it got the 28th rank on the TIOBE Index on July 2022, when C got the 2nd rank. It's not common to use D. If you want to learn a more advanced language than C but with a very similar syntax, start to learn C++.

C influenced and still influences a lot of programming languages (PHP, Perl, Objective-C, Java, and more...)

It uses an imperative paradigm, but can be multi-paradigm

Hello World !

This example shows how to make your first "Hello World" with the C language :

#include <stdio.h>

int main(void) {
    printf("Hello world!\n");
    return 0;
}

What ??? But, how to make it working ?

Here we are. You have to install a compiler to transform the C code into a binary file that could be executed on your system. In this tutorial, we will use the GNU C Compiler (GCC) 1 but it exists other C compilers like Clang.

Compiler installation

As said above, we use "gcc" for this tutorial. Try to see if you don't already have it installed on your computer by typing gcc -v in your terminal command shell.

We also have to install the "make" software that will be discovered in another post on this course.

  • Ubuntu : sudo apt update && sudo apt install build-essential
  • Fedora : sudo dnf install gcc make
  • Arch : sudo pacman -S gcc make

We will run our "Hello world" script in the next post.

Common confusions

"C" should not be confused with "C#" or "C++".

You've probably already seen "C/C++" notation somewhere on the Internet. But it's a bad usage to confuse both languages to one thing.

Actually, C++ is derived from the C language, but today it's very different from C. Just because you know C doesn't mean you are a C++ programmer and vice versa.


  1. I wrote that "GCC" was standing for "GNU C Compiler" to make the name easily understandable. But today it's called "GNU Compiler Collection" because it includes other languages, it's not only a C compiler.