Hello World
//引入输入输出需要的头文件
#include <stdio.h>
#include <stdlib.h>
//main方法是程序的入口
void main()
{
//格式化输入输出方法printf,用于在屏幕上打印指定的内容
printf("Hello World");
}
About Hello World
For beginners, the Hello World program is definitely the first teacher of your learning career. why would you said this? Because when you're a difference of one letter is not entered this code in the editor, click compile, link, after running a display in the window Hello world
, the hearts of excitement is second to none.
Why did you choose Hello world as the entry program for beginners? That is because of the following points:
-
Small but complete
-
The main header file included in a C program, the main function of the program entry, and the statement. Helloworld simple implementation of the program on the screen output
Hello World!
function
Simple enough
- If a person who is first exposed to a program to see a complex structure or more than ten lines of program code, it will discourage many people at first, even if a newcomer has enough patience to chew this hard bun, the final result It also greatly affected his desire to learn. Have a sense of accomplishment
- A novice memorizes this code almost effortlessly, and then basically has a general understanding of the structure of the program, and can change the output string by himself, such as his name and so on.