- ..clause 1..: Reserved word
- ..clause 2..: Output conversion finger fixed child
- ..clause 3..: Input conversion finger fixed child
- ..clause 4..: Operator and priority level
- ..clause 5..: Storage class finger fixed child
- ..clause 6..: Escape character
- ..clause 7..: Constant that has been defined
A basic reserved word of C language is as follows.
[ Reserved word ]According to the compiler, the reserved word might be defined excluding this.
auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
The reserved word also : as a macro name though it can use.
Do not use it because it becomes the origin of confusion.
Actually, though it is possible to use for the variable identifier etc. because main is not a reserved word without trouble
I think that I need not purposely use it because there is a sense of incompatibility.
It is output conversion finger fixed child's format and material concerning a finger fixed child.
[ Format of conversion specifier ]Tie and specify these. A finger fixed children other than the type can omit it.
% optional length. Accuracy type
[ Optional list ]
- Display it by left justify.
Display it by + right justify.
# Do not control 0 or the decimal point.
[ Format of length and accuracy ]- 0It peels off and include it in length and accuracy in [seikaku] for the explanation though it is optional.
The numerical value of length The numerical value of L and accuracy is assumed to be P.
Output L by L digit even if it is the lowest. Make up blanking in space.
Output 0L by L digit even if it is the lowest. Make up blanking by 0.
Output the entire L.P and output below L digit and the decimal point by P digit even if it is the lowest.
Do not output the entire L.0 and do not output below L digit and the decimal point even if it is the lowest.
[ Type list ]%f is a correct answer to use to display the double type.
Decimal number of d and i integer.
o Octal number sign none of integer.
Hexadecimal sign none of x and X integer. The small letter and X : x in the capital letter.
Decimal number of u integer sign none.
F real number.
Exponential form of e and E real number. In e, the small letter and E are capital letters.
The output or the exponential form is usually selected in proportion to the size of g and the G real number.
C 1 character.
S character string. Output it to a null character.
Output it as an address of the p pointer. Hexadecimal capital letter.
Output of number of characters to which n has been written so far. Do not convert the type.
Output of % character %. Do not convert the type.
It is input conversion finger fixed child's format and material concerning a finger fixed child.
Chiefly, it is the one used by the scanf function etc.
[ Format of conversion specifier ]Tie and specify these. A finger fixed children other than the type can omit it.
Length size of %* type
* Skip the digit situation with [wo] and data. (Do not substitute it for the variable. )
Use it so that unnecessary data may fly when the data of the file is read.
Read figures only of the number of digits (Or, character string) when you specify length.
It is used to make neither the limitation of the number of digits of figures nor the area in the character string buffer exceeded.
[ Size list ]
Convert data that reads h into the short type.
Match data that reads l to the specification of the type, and convert it into the long type or the double type.
Convert data that reads L into the long double type.
[ Type list ]Because an input conversion finger fixed child substitutes it, the specification of the type becomes severe.
Decimal number of d int type.
o Octal number of int type.
Hexadecimal number of x int type.
I int type. -adic number is additionally decided to data.
Decimal number of sign none of u unsigned int type.
F float type
Exponential form of e and E float type. In e, the small letter and E are capital letters.
It is g, a usual G form or an exponential form.
Character of c char type.
Character string of char type that doesn't contain s blank.
Value of p pointer.
Substitute the number of characters to which n has been read so far. Do not read data.
Do not do the % anything. Meaningless specification.
Because the priority of operator of C is thought very well
In popular use, specifying it () need not be put, and
It is most that it goes well by writing as shown in the expression.
However, when the priority level is uneasy ..seeing and the comparison of this table..
() It is easy and is certain to put up [wo].
[ Operator and priority level of C language ]The alias that seemed to be general it was used for how to call though it was especially irregular.
The priority level has risen in the one that is up.
The sign in the delimited each part becomes the same priority level.
Name Sign Function Combinatory rule Number of terms Array subscript [] Specification of array element number The right from the left Monadic Function call () Call the function. The right from the left Monadic Element selection Select the element of the structure. The right from the left Monadic ----------- --- -------------------- ---- -- Arrow -> Select the element of the structure pointer. The right from the left Monadic Postposition increment ++ One increases the value of the variable. None Monadic Postposition decrement -- One decreases the value of the variable. None Monadic Prepositive increment ++ One increases the value of the variable. None Monadic Prepositive decrement -- One decreases the value of the variable. None Monadic Reference * Access the variable that the pointer does. None Monadic Address & Access the address of the variable. None Monadic Monadic plus + Make it to a positive value. None Monadic Unary minus - Make it to a negative value. None Monadic Logical negation ! Reverse the state of the truth and the imitation. None Monadic [Saizuobu] sizeof Acquire the size of the variable, the array, and the type. None Monadic Cast (type) Convert compulsion into a specified type. The left from the right Monadic ----------- --- -------------------- ---- -- Multiplication * Multiplication The right from the left Clause 2 Division / Dividing calculation From the left Clause 2 Surplus % Too much The right from the left Clause 2 ----------- --- -------------------- ---- -- Addition + Addition The right from the left Clause 2 Subtraction - Subtraction The right from the left Clause 2 ----------- --- -------------------- ---- -- Left shift << Move the value of the variable to the left of one bit. (twice) The right from the left Monadic Right shift >> Move the value of the variable to the right of one bit. (half) The right from the left Monadic ----------- --- -------------------- ---- -- Small < It is true when left values are smaller than the right. The right from the left Clause 2 Greatly > It is true when left values are larger than the right. The right from the left Clause 2 As follows <= It is true when a left value is below the right. The right from the left Clause 2 This concludes my report. >= It is true when a left value is more than the right. The right from the left Clause 2 ----------- --- -------------------- ---- -- Equivalence == The truth when the left is equal to right value The right from the left Clause 2 Inequitable value != The truth when left, right value is different The right from the left Clause 2 ----------- --- -------------------- ---- -- Bit AND & Take AND. The right from the left Clause 2 ----------- --- -------------------- ---- -- Bit exclusive-OR ^ Take the exclusive-OR. The right from the left Clause 2 ----------- --- -------------------- ---- -- Bit OR | Take OR. The right from the left Clause 2 ----------- --- -------------------- ---- -- Logic AND && When both the left and the right are the truth, it is true. The right from the left Clause 2 ----------- --- -------------------- ---- -- Logic OR || When either the left or the right is the truth, it is true. The right from the left Clause 2 ----------- --- -------------------- ---- -- Condition ?と: Substitute the former expression at the truth and substitute the type at the imitation. The left from the right Clause 3 ----------- --- -------------------- ---- -- Substitution = Substitute the value of a right expression for a left variable. The left from the right Clause 2 Substitution multiplication *= Substitute the multiplication of the value with a right expression for a left variable. The left from the right Clause 2 Substitution division /= Substitute the dividing calculation of the value with a right expression for a left variable. The left from the right Clause 2 Substitution surplus %= Substitute the remainder of the value with a right expression for a left variable. The left from the right Clause 2 Substitution addition += Substitute the value with a right expression in a left variable and substitute addition. The left from the right Clause 2 Substitution subtraction -= Substitute the value with a right expression in a left variable and substitute the subtraction. The left from the right Clause 2 Left shift substitution <<= Substitute a left shift of the value with a right expression for a left variable. The left from the right Clause 2 Right shift substitution >>= Substitute a right shift of the value with a right expression for a left variable. The left from the right Clause 2 Bit AND substitution &= Substitute AND of the value with a right expression for a left variable. The left from the right Clause 2 Bit exclusive-OR substitution ^= Substitute the exclusive-OR of the value with a right expression for a left variable. The left from the right Clause 2 Bit OR substitution |= Substitute OR of the value with a right expression for a left variable. The left from the right Clause 2 ----------- --- -------------------- ---- -- One by one , Unite the expressions. The right from the left Clause 2
The reference operator is an operator that usually switches the pointer variable to the variable mode.
There is no relativity on the grammar with * put when the pointer variable is declared.
The array subscript operator means [] put on the array.
The function is to add up a bite-sized amount of the variable to the address.
There is no relativity on the grammar with [] put when the array is declared.
The conditional operator is the one to make the conditional expression easily, and it uses it for the way below.
[ Conditional operator ]Expression 1 is executed when the conditional expression is the truth, and expression 2 is executed at the imitation.
( conditional expression) ? expression 1: Expression 2;
The operator is the one one by one said that two expressions will be brought together in one.
[ Operator one by one ]In this example, previously i = Three is calculated, and, next, i + Two is calculated.
j = (i = 3 , i + 2 );
The following storage class finger fixed children are prepared in C language.
However, the one that has not already been used seems to be abundant.
[ Storage class finger fixed child ]
auto
register
static
extern
typedef
[ Auto finger fixed child ]
It means the variable is an automatic variable.
However, it automatically becomes an automatic variable internally of the function.
It is a meaningless finger fixed child because it becomes an error outside the function.
[ Register finger fixed child ]
It means the variable is frequently used.
In allocating this variable in the register in old times
Though processing had been sped up
The optimization facility of the compiler is given to priority now.
[ Static finger fixed child ]
It means the variable is used statically.
In the function, the value of the variable comes to be maintained in the function.
Outside the function, the variable becomes effective only in the source file.
[ Extern finger fixed child ]
It means the definition of the variable etc. is done in other places.
It is used to declare a common variable in the header file.
[ Typedef finger fixed child ]
A new type is declared.
It is possible to check it by can easily do the type declaration, and the compiler.
- It is included here in the convenience of the grammar though it is originally irrelevant to the storage class.
It is the one in the screen used to operate the display of the character string etc. though cannot display.
In addition, there are the following one though \n that changes line is after all famous.
[ Escape character ]It is \n and \t to be often used in this.
Escape character Hexadecimal number Function \a 07 Sound the beep sound. \b 08 Move it behind one cursor position. \t 09 Move the cursor position to the following tab position. \n 0A Move the cursor position to the following line. (changing line) \f 0C Exhaust paper. (Only for the printer. ) \r 0D Move the cursor position leftmost of the line. (Change line in Mac. ) \\ 5C Display \. \' 2C Display ' \" 22 Display " \? 3F ?Display [wo]. \ figure It is the same in the octal number. Display the character-code of the corresponding octal number. \x figure It is the same as the figure. Display the character-code of the corresponding hexadecimal number.
Though the escape character uses two characters or more for the mark
Actually, it is one character to the last.
In C language, information on the processing system and information, etc. that can be used for debugging
It prepares it as a defined constant.
[ Constant for debugging ]__ When program is executed by using FILE__ and __ LINE__
__ Line number from which LINE__ is executed
__ Source file name in which FILE__ is executed
__ Date to which DATE__ was compiled
__ Time to which TIME__ was compiled
[ Constant that has defined integer type size ]It is compiler dependence whether to make the char type with the sign.
# define < limits.h > is necessary for the use of these constants.
Size of each bit of CHAR_BIT char type.
The maximum value of CHAR_MAX char type.
Minimum value of CHAR_MIN char type.
The maximum value of INT_MAX int type.
Minimum value of INT_MIN int type.
The maximum value of LONG_MAX long type.
Minimum value of LONG_MIN long type.
The maximum value of SCHAR_MAX signed char type.
Minimum value of SCHAR_MIN signed char type.
The maximum value of SHART_MAX short type.
Minimum value of SHART_MIN short type.
The maximum value of UCHAR_MAX unsigned char type.
The maximum value of UINT_MAX unsigned int type.
The maximum value of ULONG_MAX unsigned long type.
The maximum value of USHRT_MAX unsigned short type.