I want to use this code (from my last question (thanks Adam)),
bool AllDigitsIdentical(int number)
{
int lastDigit = number % 10;
number /= 10;
while(number > 0)
{
int digit = number % 10;
if(digit != lastDigit)
return false;
number /= 10;
}
return true;
}
but the compiler just says in the second line at } :
Nested functions are disabled, use -fnested-functions to re-enable
What can I do in my case? I have no plan…
Thanks and sorry for my bad English.
You wouldn’t happen to have something like:
That is, you have a function declared within a method’s scope of implementation (though the same problem would occur for a function declared within a function).
In short, don’t do that. It isn’t supported and the means via which GCC implements it is considered to be a bit of a security hole (IIRC).
Move it outside: