OT: Programming in C
Steven W. Orr
steveo at syslang.net
Sat Apr 19 19:09:43 UTC 2008
On Saturday, Apr 19th 2008 at 14:42 -0000, quoth Bill Davidsen:
=>Steven W. Orr wrote:
=>
=>> Quiz for next Friday. What are these and what's the difference between them:
=>>
=>> int (*(**p)[])(int)
=>declare p as pointer to pointer to array of pointer to function (int)
=>returning int
=>
=>> and
=>> int *(*(**p)[])(int)
=>declare p as pointer to pointer to array of pointer to function (int)
=>returning pointer to int
Both correct. You get to stay after class and clap out the erasers. :-)
=>I would really want to see both a justification of method and
=>certificate of sanity to someone who actually used either. I can just
=>barely justify pointer to array of function returning int (state
=>machines), these look like something a compiler compiler would do.
It does get a bit quazee, but the point of the discussion was not to find
something wacko and then to justify it. The point was that there are too
many people programming in C/C++ who don't know how to do it and who
either get it wrong or don't implement what was needed in the first
place. (And it really isn't that hard to learn.)
I can't tell you how many times I go into a place and see that compiler
warnings are never fixed, thus causing these types of incorrect uses to
somehow still work (maybe most of the time too!). I can't tell you how
many times I go into a place and see include files with static
declarations because they didn't know how else to initialize global data,
and never even realizing that the data was occupying hundreds or thousands
of times more space than they intended.
--
Time flies like the wind. Fruit flies like a banana. Stranger things have .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
More information about the fedora-list
mailing list