Friday, May 31, 2013

C Quiz

Mike Ash:

The C language is perhaps the most popular computer language in existence, but it’s also quite odd, and because of that often poorly understood. I’d like to give you a quiz to see how much you know about some of the odd but useful corners of the language.

The strangest one for me is that free(NULL) is defined as a no-op. I seem to remember reading or being taught early on that this was dangerous. CFRelease will indeed crash, although some variants like CGImageRelease will not.

3 Comments RSS · Twitter

There will be odd corners in any language, but maybe only in C do these corners stick up through the floor in the middle of the room, and only in C do people do the 3D equivalent of hanging a painting over it.

Actually, scratch that. C++'s room is a large room with a set of interconnected mezzanines where the highest ones look significantly nice. However, the room is an anechoic chamber in camouflage. There are almost no uncorrugated surfaces, and the spikes are made alternatively of diamond and dull saw blade. Some protude enough to actually cross the room and enter the other end.

And yeah, architectural structural unsoundness metaphoric fan fiction might now be a thing.

Are you possibly thinking of freeing the same pointer twice?

Leave a Comment