These days to C language has a preliminary understanding, read a lot of grammar knowledge.
#include <stdio.h>
int main ()
{
printf ("Hello world\n");
return 0;
}
This is the first simple program that I have come into contact with, I believe most people start with Hello Word!
In addition to the knowledge of the variable, the name of the variable should not be the same as the keyword, this is easy to understand.
There is also a const keyword, it can make the variable in the program to keep its initial value, as long as the Const keyword is placed before the type of the variable (it is also possible) such as: const int NUM = 7 (variable name is generally uppercase, not mandatory)
A little difference between the scanf and printf functions:
For a double of float, the substitution in printf is%f, but in scanf it is not the same, and in scanf, float is%f,double%lf. In fact, is a double type in the scanf inside the substitution is%lf more than a l, the others are the same!
Can only record so much, this is my 0 basis for the first study, there is no place to hope friends to give some advice ah, in the future I will practice a lot, will be the code on the book first knock it over! Kung Fu is not a conscientious, I will certainly succeed!
Initial contact with C language