Wednesday, 6 December 2000

On C++ and Copy Constructors

A date which will, indeed, live in infamy. The day after that.

'That', for the benefit of those of you who are mind-bogglingly stupid, was the most god-awful, dreadful, terrible, evil, vicous, cold-hearted, despicable, ravenous, soul-reaving, examination in my life. And I've written a few before that haven't gone so well. This week.

My personal favourite was Question #2. It asked us to determine the output pr
oduced by this little snippet of source code. It used a struct, a construct which I vaguely recall from C, and which indeed was used in the text once, on a page I'm pretty sure we didn't read, to implement the Canonical Construction Idiom for a simple object which, quite obviously, didn't need, because it didn't manage any resources. Anyhoo, here's the correct answer.

Suffice it to say, I'm still in mourning. For all of us. And for all the people who took Java as well. I hear the final was, shall we say, equally unfortunate as ours. D'oh.






No comments:

Post a comment