I wouldn't return "NULL". Returning an empty string would be easier for everybody.
Code:
string auxiliary_p(string s)
If you can, prefer passing large and complex objects by const reference (that is, unless you indeed want a copy to be made)
Code:
string auxiliary_p(const string& s)
Code:
string ret("placeholder");
istringstream in(s);
in>>ret;
I don't think filling the string with "placeholder" is necessary.
Code:
bool answer(string s)
{
short n(s.size());
while(n>1)
n%=2;
return static_cast<bool>(n);
}
This seems to be a longwinded way of doing
Code:
bool answer(const string& s)
{
return s.size() % 2 == 1;
}
That doesn't make the answer particularly random, though. The same question always receives the same answer. Picking a random answer might involve something like
Code:
bool answer()
{
return std::rand() % 2 == 1; //include <cstdlib>
}
The meaning of a parameter with a name like that might be a bit unclear.