Mail Archives: djgpp/2000/12/18/10:42:40
Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote:
> Kevin Mitchell <mitchll AT istar DOT ca> wrote:
> > What, on your system, are the restrictions on the pointer types char*,
> > int*, and void*? For example, may and int have an odd value? Hint:
> > alignment.
>
> Sigh... and I had thought a book as widely respected as this one would
> know better than to meddle useless implementation details with those
> of the subject programming language. You do not need to know the
> answer to any of these questions to write good C or C++ code.
> Actually, your code will probably be better if you *don't* know the
> answers to these questions.
I think Stroutrup's point is to make clear that compilers may differ
in implementation while still conforming to the standard, and that you
*do* need to be able to answer the questions, in a portable way,
rather than make assumptions.
The idea seems to be to write code (rather than simply ask in a
newsgroup). It's a useful exercise, to discover sizeof(), <limits>,
etc., although you might consider maximum name length suspect
knowledge.
I doubt though, that VC++ would provide the answers "in about 3 mouse
clicks..."
- Raw text -