Integer types:
Char Type:
The long data type often has 8 bytes (64 bits) on 64-bit systems. The size of the integer types is not defined in ANSI-C. But the order is as follows:
Char <= short <= int <= long
The type short must be at least 2 bytes long and at least 4 bytes large. If you are interested in the exact size on your system, you can look at the limits file header file. It is easier, however, as mentioned, with the sizeof operator.
Floating point types:
Allocation
After a variable has been declared, you can specify the value to store. This process, in which one tells the variable what value to store, is called an assignment.
Example: I = 10; Assume that the variable i is of type int, then the value is assigned to the value 10 (an integer). After this, variable i stores this value. In general it can be said: Variable = value; Instead of variable, you set the identifier of the variable to which you want to assign a value. The assignment operator follows the right of the identifier. The assignment operator ensures that data is "transported" to the variable and signals that it is an assignment. To the right of the assignment operator is the value that the variable should store. This can also be a different variable, then the value of the right variable is assigned to the left variable, ie copied to the left variable. It is always transferred from right to left. IMPORTANT: The assignment operator = is NOT a comparison for equality! The variable, which is on the left, has the right value, but the equality operator (==), which you will get to know later on, must be strictly distinguished from this! The meaning of the = in C is thus different from what you probably know from mathematics. You already know the initialization of variables during their declaration. Here again for the repetition: Type Identifier = value; For example: Int i = 0; If several variables of the same type are agreed, it is also possible to initialize only some of them. An example: Int i, j = 20, k = 100, l; Here, we declare the variables i, j, k, and l. We immediately assign values to the variables j and k, while the others do not. The assignment of constants is very important. Without assignment, constants would be useless. Const int repetitions = 10, mode = 1; Then the constant repeats with the fixed value 10 and the constant mode with the value 1.
Thank you for being with coder mania BD.
Example: I = 10; Assume that the variable i is of type int, then the value is assigned to the value 10 (an integer). After this, variable i stores this value. In general it can be said: Variable = value; Instead of variable, you set the identifier of the variable to which you want to assign a value. The assignment operator follows the right of the identifier. The assignment operator ensures that data is "transported" to the variable and signals that it is an assignment. To the right of the assignment operator is the value that the variable should store. This can also be a different variable, then the value of the right variable is assigned to the left variable, ie copied to the left variable. It is always transferred from right to left. IMPORTANT: The assignment operator = is NOT a comparison for equality! The variable, which is on the left, has the right value, but the equality operator (==), which you will get to know later on, must be strictly distinguished from this! The meaning of the = in C is thus different from what you probably know from mathematics. You already know the initialization of variables during their declaration. Here again for the repetition: Type Identifier = value; For example: Int i = 0; If several variables of the same type are agreed, it is also possible to initialize only some of them. An example: Int i, j = 20, k = 100, l; Here, we declare the variables i, j, k, and l. We immediately assign values to the variables j and k, while the others do not. The assignment of constants is very important. Without assignment, constants would be useless. Const int repetitions = 10, mode = 1; Then the constant repeats with the fixed value 10 and the constant mode with the value 1.
Thank you for being with coder mania BD.
No comments:
Post a Comment