Re: Nice Quiz for beginners at http://www.geocities.com/spicelinux/



"Andrew Poelstra" <joey.graham@xxxxxxxxx> wrote:

> shane wrote:
> > There is a nice quiz on C for beginners at
> > http://www.geocities.com/spicelinux/
>
> Oh, my, where to begin.
>
> Q1: As has been stated, both B and C have arguments for them.

C has no good arguments for it, because it's wrong. Unions and structs
_are_ quite different, but there is also a great deal of similarity. B
has some arguments for it, but it's only right as far as it goes: there
are more subtleties to the difference between structs and unions than
that.

> Also, why would a beginner ever need to use unions? I've only ever seen
> them used in code being linked into assembler, hardly a beginner's task.

When I've used them, it was for implementing variants in an ODT. Not
something a beginner should use, true, but it is something a beginner
should recognise when used by others.

> Q2: What is an "Interger"? I assume you mean "Integer", which is
> unneccessarily capitalized. The answer is true in the mathematical
> sense, but in the C sense, a char is not an int.

Irrelevant. The question is about a character _constant_, which does
have type int. Even if it were about char itself, char is not int, but
it _is_ an integer.

> Q3: I have never seen the register keyword used.

I have, but not recently with any reason, and I agree that a beginner
need not know about its workings.

> Q4: Most beginners don't even use pointers, let alone do math with
> them!

I should hope they do. It's one of the most fundamental areas of C.

> A far better quiz would take one question from each chapter of TYC in
> 21 Days.

No, any good quiz at all would stay far away from "In 21 Days", "In 24
Hours", "For Dummies", and all of that ilk.

Richard
.