Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!physik.tu-muenchen.de!berg From: berg@physik.tu-muenchen.de (Stephen R. van den Berg) Newsgroups: comp.lang.c Subject: const struct -- what does exactly mean? Message-ID: <4423@rwthinf.UUCP> Date: 27 Jun 91 15:18:55 GMT Sender: news@rwthinf.UUCP Lines: 23 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@messua.informatik.rwth-aachen.de Stephen R. van den Berg. berg@physik.tu-muenchen.de "And now for something *completely* different!"