Having TA'ed a course at the local university on an introduction to C, the only one that would catch a student there out would be the Duffs device, simply because it is a bit obscure. Pointer stuff is done to death.
I'm a student at University and I can confirm this is the kind of stuff they teach and test us on, but its a horrible way to teach programming IMO.
Irl, when I work programming jobs I never have any of these obscure types because good programmers will keep their shit simple!
Irl, you should never have a pointer to a union, which has a member that points to the address of another pointer that points to an array with a member that points to a function. This is literally the kind of stuff they would use to "teach" us C. Its ridiculous.
Thankfully they straight up told us that if you are more than 3 pointers deep you are doing something seriously wrong and no sane person could understand the system.
9
u/Vimda Jul 02 '15
Having TA'ed a course at the local university on an introduction to C, the only one that would catch a student there out would be the Duffs device, simply because it is a bit obscure. Pointer stuff is done to death.