C Language Foundation (i)

Source: Internet
Author: User

1, write code Considerations:      (1) Do not forget to import the header file #include <stdio.h>      (2) The main function has only one       (3) After writing a line of code to have the English semicolon as the end "; "      (4) denotes the English curly braces" {  "and" &NBSP;} "of the block of code. Must appear in pairs       (5) return 0 must be placed at the end of the program, after the code is not executed, you can omit       (6) "/" is a translator, plus different letters to represent different functions, the most commonly used "/n" is the newline character  2, C language compilation process:       (1) Create a C file Touch first.c      (2) Input code           #inlcude& lt;stdio.h>          int main ()           {    &N Bsp          printf ("Hello world!\n");              & Nbsp;return 0;          }      (3) Compile C file cc first.c-c, generate target file " FIRST.O "      (4) Link destination file with library function target file cc FIRST.O generate executable a.out      (5) Execute this executable file./a.out on the screenOn output "Hello world!"       NOTE: Regardless of the source file's file name, the resulting executable is a.out  3, data type       shaping: int integer takes 4 bytes     & nbsp           long Long integer 8 bytes                 Short Integer 2 bytes       Real (float type): Float single precision 2 bytes                     & nbsp             Double double 4 bytes       Char: char requires single quote "'"     &nbs to describe a single letter p; Note: Commonly used for development is int and float 4, comments      //: Single-line comments to explain a line of code      /* */: Block comments, The ability to interpret a piece of code or to indicate the file at the beginning of a code file       develop a habit of writing comments that will make your code more readable    

C Language Foundation (i)

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.