Академический Документы
Профессиональный Документы
Культура Документы
ANSI/ISO Standard C
and
ISO Sales
Case Postale 56
CH-1211 Geneve 20
Switzerland
int func(x)
float x;
{ ...
References: K&R1 Sec. A7.1 p. 186; K&R2 Sec. A7.3.2 p. 202; ANSI
Sec. 3.3.2.2, Sec. 3.5.4.3; ISO Sec. 6.3.2.2, Sec. 6.5.4.3;
Rationale Sec. 3.3.2.2, Sec. 3.5.4.3; H&S Sec. 9.2 pp. 265-7,
Sec. 9.4 pp. 272-3.
struct x;
const int n = 5;
int a[n];
A: The const qualifier really means "read-only;" an object so
qualified is a run-time object which cannot (normally) be
assigned to. The value of a const-qualified object is therefore
*not* a constant expression in the full sense of the term. (C
is unlike C++ in this regard.) When you need a true compile-
time constant, use a preprocessor #define.
References: ANSI Sec. 3.4; ISO Sec. 6.4; H&S Secs. 7.11.2,7.11.3
pp. 226-7.
You must use explicit casts (e.g. (const char **) in this case)
when assigning (or passing) pointers which have qualifier
mismatches at other than the first level of indirection.
11.12: Can I declare main() as void, to shut off these annoying "main
returns no value" messages?
References: ANSI Sec. F.5.1; ISO Sec. G.5.1; H&S Sec. 20.1 pp.
416-7.