You don't; it's basically, "here's an array, now reverse it" (keep in mind a pointer is not an array).
http://www.lysator.liu.se/faq/c-faq/c-2.html
The general point is that interviews of this type are counterproductive.
http://www.lysator.liu.se/faq/c-faq/c-2.html
The general point is that interviews of this type are counterproductive.
If you want to posit any kind of sane question, then you can have a sane solution.
That's what I said a few posts ago.
> You can't claim to have a solution for the problem if it only works for a
> fixed input, and if the solution itself would be different for different
> inputs.
"Reverse this array". Done. "Reverse an unspecified array of arbitrary length" is a different problem :)