C Language Programming Basics------0.5.1 C Application The simplest program---Hello world!

Source: Internet
Author: User

#include <stdio.h>

The first step is to add the header file where the code is used for the library function. If the relevant library function is not used in the code, then you do not need to add the relevant header file

such as: Need to go to the standard input and output, printf,scanf and other library functions, you need to add stdio.h header file

Need to use string correlation function, strcpy,strcmp and other library functions, you need to add String.h header file


Note: C code in the need to use the library function in the header file, please inquire "C language function library detailed (collection version)" or "Linux-c Common library function Manual"


int main (int argc, char **argv)

int main (int argc char *argv "")///Standard C application entry function, where argc argv the meaning of these two parameters, refer to

{
printf ("Hello world!\n");//standard print output function, defined in <stdio.h>

Return 0;//Returns the value, see the definition of the function, the function is defined as int, so we need to return an int type data

Notice the difference between return and exit

}


C Language Programming Basics------0.5.1 C Application The simplest program---Hello world!

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.