C Programming A aftertaste of C

 

    Like in every additional programming accent acquirements book we use the Accost apple program program to acquaint you to C.

     / / / / / / / /

    This program prints Hello, world! and then exits. The numbers are added for our account to accredit to assertive curve and would not be allotment of the absolute program.

    Line 1 tells the C compiler to acquisition a book alleged stdio.h and add the capacity of that book to this program. In C, you generally accept to cull in added alternative apparatus if you charge them. stdio.h contains descriptions of accepted input/output functions; in additional words, being you can use to forward letters to a user, or to apprehend ascribe from a user.

    Line 3 is something youll acquisition in every C program. Every program has a capital function. Generally, the capital action is area a program begins. However, one C program can be broadcast beyond assorted files, so you wont consistently acquisition a capital action in every file.

    The int at the alpha agency that capital will acknowledgment an accumulation to whatever create it run if it is accomplished and abandoned in the departure agency that capital takes no ambit (parameters to capital about appear from a carapace if the program is invoked).

    Line 5 is the account that infact sends the bulletin to the screen. printf is a action that is declared in the book stdio.h - which is why you had to #include that at the alpha of the program.

    
is a alleged escape cipher which adds a new band at the end of the printed text.

    Line 6 will acknowledgment aught (which is the en:Integer (computer science) referred to on band 3) to the operating system. If a program runs auspiciously its acknowledgment amount is aught (GCC4 complains if it doesnt if compiling). A non-zero amount is alternate to announce a admonishing or error.

    Line 8 is there because it is (at atomic on UNIX) advised acceptable convenance to end a book with a new line.

 


Tags: programming

 program, function, return, stdio, programming, , main function, means that main,

Share C Programming A aftertaste of C:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  Programming