Re:Interviewing programmers: coding test example explained
by JoachimSchipper on Thursday June 03, 2010 @10:02AM
(#1401306)
Although I'm not sure "its K&R equivalent" is correct (that's C89 and has "modern" function implementations), C99 is indeed not that common. If only because many compilers don't support it (including Microsoft's).
Re:Interviewing programmers: coding test example explained
by js2 on Thursday June 03, 2010 @10:09AM
(#1401334)
Bah, I learned my C from K&R 2nd ed. I guess that's not K&R C, is it? :-)
Re:Interviewing programmers: coding test example explained
by JoachimSchipper on Thursday June 03, 2010 @03:01PM
(#1402168)
It's... complicated. K&R 2nd ed. (which is an excellent book!) is based on a draft of ANSI C; pre-ANSI C was not standardized but rather based on an informal reading of K&R 1st ed., hence "K&R syntax" and the like.
At least, if I recall correctly.
Re:Interviewing programmers: coding test example explained
by RiderOfGiraffes on Thursday June 03, 2010 @09:53AM
(#1401281)
1) In TFA, s/cersion/version/,
but that's an amusing typo.
:-)
Bother - now fixed. Thanks.
2) Initializing inside the for loop requires C99; is that to be considered idiomatic? I didn't think so. I'll be curious how many submissions were either identical to your suggested idiomatic solution or its K&R equiv:
https://gist.github.com/3f4daf24595788258a01
:-)