Basic types
The C language provides the four basic arithmetic type specifiers char, int, float and double, and the modifiers signed, unsigned, shortand long. The following table lists the permissible combinations to specify a large set of storage size-specific declarations.
C is a free-form language.
Bracing style varies from programmer to programmer and can be the subject of debate.
The following is a table that lists the precedence and associativity of all the operators in the C languages.
Operators are listed top to bottom, in descending precedence. Descending precedence refers to the priority of evaluation. Considering an expression, an operator which is listed on some row will be evaluated prior to any operator that is listed on a row further below it. Operators that are in the same cell (there may be several rows of operators listed in a cell) are evaluated with the same precedence, in the given direction.
In Mathematics, there is no limitation on number. But, in computer world, everything are in binary format, and there are limited amount of memory.
Different data are represented in different ways in computer memory, and have different value ranges.
In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variablename; in other words, it copies a value into the variable. In most imperativeprogramming languages, the assignment statement (or expression) is a fundamental construct.
Today, the most commonly used notation for this basic operation has come to be x = expr
(originally Superplan1949–51, popularized by Fortran 1957 and C) followed by x := expr
(originally ALGOL 1958, popularised by Pascal).
试试一个变量名最长可以有多长?
In computer languages, identifiers are tokens (also called symbols) which name language entities. Some of the kinds of entities an identifier might denote include variables, types, labels, subroutines, and packages.
Format string specifications
The formatting placeholders in scanf
are more or less the same as that in printf
, its reverse function.
There are rarely constants (i.e. characters that are not formatting placeholders) in a format string, mainly because a program is usually not designed to read known data. The exception is one or more whitespace characters, which discards all whitespace characters in the input.
为什么要有“回车”?
Strings
In C, string constants (literals) are surrounded by double quotes ("), e.g. "Hello world!" and are compiled to an array of the specified char values with an additional null terminating character (0-valued) code to mark the end of the string.
Page 3 of 4