Subj : Re: Software Job Market Myths To : comp.programming,comp.software-eng From : CTips Date : Thu Aug 18 2005 12:55 am Matt Atterbury wrote: > CTips writes: > > >>>>>>Firstly, the name is wrong. (Why?) >>>>> >>>>>Yep. (Conflicts with authority.) >>> >>> >>>>>>Secondly, some qualifiers are missing from the input parameters. >>>>>>(Which?) >>>>> >>>>>Yep. (I'm constantly wondering about stuff like that.) >>> >>> >>>>Sorry, you're both wrong about these two. Care to guess why? >>>> >>>>[Yes, its a little nit-picky, but as long as we're testing C >>>>programmers, we might as well get it right.] >>> >>> >>>Okay, I'll fessup--I'm stumped. >>> >> >>Hint: you forgot a #include ... > > > I suspect the problem is that `str' is a POSIX standard, and, in > isolation, this code is not [necessarily] POSIX compliant. OTOH, > the compiler might [be able to] enforce/check POSIX compliance > without the header file. > > NFI why `const' is "wrong" :-) > > m. This code might be running on a freestanding implementation, in which case the strcat/strcpy functions might be roll-your-owns, in which case both the str being reserved and the addition of const-ness are not correct. Further (and I may be wrong on this one), IIRC, the ANSI/ISO standard, states that names beginning with str are reserved if the header string.h/stdlib.h is included (I don't remember exactly how future directions are handled - are they always reserved, or only if the header is included). .