const struct -- what does exactly mean?
Stephen R. van den Berg
berg at physik.tu-muenchen.de
Fri Jun 28 01:18:55 AEST 1991
Suppose I declare the following (in ANSI-C, what else):
----------
struct hello {char*a; char**b;};
const struct hello var;
----------
What does that mean?
Which of the following 'var's have I actually declared:
1. struct {char*const a; char**const b;} var;
2. struct {const char*const a; const char*const*const b;} var;
3. struct {const char*a; const char**b;} var;
4. none of the above, the 'const struct hello var' declaration is illegal.
My bets are on answer number 1, but what is your opinion?
(And yes, answers 1 till 3 are VERY distinct answers, to any conforming ANSI C
compiler that is).
--
Sincerely, berg at messua.informatik.rwth-aachen.de
Stephen R. van den Berg. berg at physik.tu-muenchen.de
"And now for something *completely* different!"
More information about the Comp.lang.c
mailing list