HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Before we learn the basic building blocks of C language, let's take a look at a minimum of C program structure, in the next section can serve as a reference.
C program includes the following components:
Let's look at a simple piece of code, you can output the words "Hello World":
#include <stdio.h> int main() { /* 我的第一个 C 程序 */ printf("Hello, World! \n"); return 0; }
Next we explain above, this procedure:
Let's look at how to save the source code in a file, and how to compile and run it. Below are simple steps:
$ gcc hello.c $ ./a.out Hello, World!
Make sure that your path is included gcc compiler, and make sure to run it in the directory containing the source file hello.c.