16-bit computer C ++ common basic data type description and character constant taken from money C ++ tutorial

xiaoxiao2021-03-06  41

Basic arithmetic operator 5 6-> 11 13.2 17.8-> 21.0-21.26 -> - 6.11 * 2 * 3-> 6 2.0 * 3.0-> 6.0 / 1 / 2-> 0 1.0 / 2.0-> 0.5% (surplus) -5% 3 -> - 2 10% 5-> 0

Math and &, arithmetic or |, arithmetic is not ~, arithmetic express or ^

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= =========================

Conditional operators: such as: x = a

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= =========================

Typedef can provide synonyms for an existing type name:

Typedef double profit; // Defines the synonym of Double

TypeDef int, integer; // Define two synonyms

Typedef does not actually define a new data type and does not assign memory space when establishing a TypedEf type.

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= ===========================================================00 Adding f or f to the LONG DOUBLE type, you must add L or L after the real number. Such as: 34.5F // Float 34.5 // Double type (default type) 34.5L // long double 34.5E23F // float type 34.5E400 // long double type (because the range exceeds Double ) ==================================================== ============================================================================================================================================================================================================= ==========================

Common basic data type description

Type Description Length (byte) Representation

Char characters 1 -128 ~ 127 (-2 seven times to 2 in 7 squares) 1)

Unsigned char None symbolic character type 1 0 ~ 255 (0 ~ 2 seven times) 1)

Signed Char has symbolic characters 1 -128 ~ 127

INT intersection 2 -32768 ~ 32767 (-2 15 times ~ 2 of 15 square minus 1)

Unsigned int unsigned integer 2 0 ~ 65535 (16th part of 0 ~ 2) 1) signed int with symbol integer 2 -32768 ~ 32767

Short Int short integer 2 -32768 ~ 32767

Unsigned short int unsigned short integer 2 0 ~ 65535

Signed short int with short integer 2 -32768 ~ 32767

Long INT long shaping 4 -2 31 square ~ 2 of 31 times minus 1

Signed long int with symbol long mold 4 -2 31 square ~ 2 of 31 times minus 1

Unsigned long int unsigned long molding 4 0 ~ 2 32 times minus 1

Float floating point 4 -3.4 * 10 38th party ~ 3.4 * 10 38 (7 valid numbers)

Double Double Accuracy 8-1.7 * 10 308 times to 1.7 * 10 (15 valid numbers)

Long Double long double precision type 10 -3.4 * 10 4932 (19 effective numbers)

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= ========================================

Define constants after const, which can only read (modify) in the program, thereby preventing this value from being unintentionally modified.

Since the constant is defined, it must be initialized when the constant is defined. Such as:

Const float pi; pi = 3.1415926; // error

Another example: const Int size = 100 * sizeof (int); // ok const Int number = max (15, 23); // Error

In C , constant definitions use const, no #define.

Program memory space

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= ========================================= Code area ........ ... (Code Area)

All-bureau data ................ (Data Area)

Pile area ................ (Heap Area)

Stack area ................ (Stack Area)

A program assigns the operating system to its running memory block to 4 areas:

1. Code area: The code of the program is stored, that is, the various function code blocks in the program.

2. Global Data Area: The global data and static data of the program.

3. Pile area: The dynamic data of the storage program.

4. Stack area: The local data of the program, that is, the data in each function.

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= ========================================== common escape characters: / N Enter Removal, the cursor moves to the next line of the first line / R Enter does not change the line, the cursor moves to the top of the Bank (8 bit is a grid, the cursor jumps to the next start position, such as the 9th or 17th place, etc.) / B back, the cursor moves left mobile one / f Paper change page // Used to output a backslash character "/" to output single quotes characters "" / "for use Output Dual quotation number character "" "/ DDD three-digit DDD corresponds to ASCII code character / XHH two hexadecimal number HH corresponding to ASCII code characters

============================================================================================================================================================================================================= ============================================================================================================================================================================================================= ==============================================================================================================================================

转载请注明原文地址:https://www.9cbs.com/read-56473.html

New Post(0)