C Language First speaking: C Foundation

Source: Internet
Author: User

1. #import function: Import the header file;

2. There are two forms of the import header file: <>, ""

<> role: Import system framework

"Role: Import files that others have written."

3. Data type Specifies the type and size of the data;4. Integral type:(1). type int: 4 bytes; (2). Short Type: occupies 2 bytes; (3). Char type: 2 bytes;               (4). Long: 64-bit system occupies 8 bytes; The 32-bit system occupies 4 bytes.

' 0 ' character 0 corresponds to decimal integer 48

0 Digit Zero

' 0 '---' 9 ' corresponds to 48--57

' A '--' Z ' corresponds to 65--90

' A '--' z ' corresponds to 97--122

' a ' + = = ' a '

5. Float Type:

(1) Single-precision floating-point type: float is 4 bytes;

(2) Double-precision floating-point type: Double is 8 bytes.

Constant: Amount not to be changed without external force

Integer constants: 89 88 6 ...;

Floating-point constants: 3.1415926 12.01 ...;

Character-type constants: ' A ' 0 ' B ' ...;

Definition of variable: data type variable name = initial value;

The variable definition must be assigned the initial value;

Naming rules for variable names:

1. Consists of numbers, letters, underscores, and numbers cannot begin;

2. Cannot be duplicate with other keywords;

3. Cannot duplicate the name of other variable names;

4. See the name of the Italian.

6. operators:

Assignment operator: "=", assigns the value to the right of the equal sign to the left variable, the process of assigning the value is the process of copying,

Copies a copy of the value to the right of the equal sign to the variable to the left of the equals sign.

Arithmetic operators: "+", "-", "*", "/", "%", "+ +", "-"

Note : + + or--before, the first self-increment (minus), then use, + + or--after the first use, in the self-increment (minus ).

Compound operator:+=,-=,*=,/=,%=

7. expression: Can be made up of constants, variables, and operators

How to tell if it is an expression: there is no value

Statement: With a semicolon ";" End

8. Format output function printf: The output of the target, is to verify that the results are correct

Conversion character

%d--INT

%HD--Short

%ld--long

%f--floating-point type (float,double)

%c-char

Escape character: \ n Enter, percent output%,\\ output \

C Language First speaking: C Foundation

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.