C Basic Knowledge "program Structure"

Source: Internet
Author: User

C Program Structure
The 1.C program mainly includes the following sections:
Preprocessor directives
Function
Variable
Statements & Expressions
Comments
2. #include <stdio.h>

int main ()
{
/* My first C program */
printf ("Hello, world! \ n ");

return 0;
}
Next we explain the above procedure:
The first line of the program #include <stdio.h> is the preprocessor directive, which tells the C compiler to include the Stdio.h file before actually compiling it.
The next line of int main () is the main function, where the program starts execution.
The next line of/*...*/will be ignored by the compiler, where the program's comment content is placed. They are referred to as notes to the program.
The next line of printf (...) is another available function in C that displays the message "Hello, world!" on the screen.
The next line return 0; Terminates the main () function and returns the value 0.

C Basic Knowledge "program Structure"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.