Chapter I basic knowledge of C language
The first section, the basic understanding of C language
1, the C language program is called the source program, also known as the compilation unit.
2, C language writing format is free, each line can write multiple statements, can write multiple lines. 3, a C language program has and only one main function, is the starting point for the program to run.
Section II, familiar with VC + +
1, VC is software, used to run the written C language program.
2, each C language program after writing, are compiled first, after the link, the last run. (. C---?. Obj---?. EXE) in this process, the. c and. obj files cannot be run, only. exe files can run. (Frequent test!) )
Section III, identifiers
1. Identifiers (Required content):
Legal requirements are made up of letters, numbers, and underscores. There are other elements that are wrong.
And the first must be a letter or an underscore. The first one is the wrong number.
2, the identifier is divided into keywords, predefined identifiers, user identifiers.
Keyword: cannot be used as a user ID symbol. Main define scanf printf are not keywords. Confuse your place if it is possible to do as a user identifier. This is not a keyword because the first letter in the if is capitalized.
Predefined identifiers: Recite define scanf printf include. Remember that predefined identifiers can be used as user identifiers.
User identifier: Basically every year, please see the book in detail.
Section Fourth: Conversion of the binary
Decimal is converted to binary, octal, hexadecimal. Binary, octal, 16 conversion to decimal.
Section Fifth: integers and real numbers
1) C language only eight or 10, hexadecimal, no binary. But at runtime, all the binaries are converted into two
To be processed in the system. (Tested two times)
The octal rule in a, C language should begin with 0. 018 of the value is illegal, octal is not 8, every 8 into 1.
The hexadecimal provisions in the B and C languages begin with 0x.
2) The legal notation of decimals: C language on either side of the decimal is 0 words, you can not write.
1.0 can be written in the C language 1.0.1 can be written in the C language. 1. 3) Legal form of real data:
A, 2.333e-1 is legal, and the data is 2.333x10-1
。
B, test formula: E before E must have a number, E must be an integer. Please combine the examples in the book. 4) The integer type is generally 4 bytes, the character type is 1 bytes, the double precision is generally 8 bytes: long int x; Indicates that x is a long integer.
unsigned int x; Indicates that x is an unsigned integer.
C Language 3