Illegal local function definition
Can you point out my error? Am I missing something obvious???
The function should return a TRUE if the number falls between -9999 and +9999. False if out of range.
Using MSV C++ 6 Intro edition found in Dietel & Dietel
bool validword(int); // declaration
if ( !validword( temp ) ) // call out
bool validword(int word) // function
{
return ( word >= -9999 && word <= 9999 );
// word must be 4 digits max (+ or -)
}
error message:
error C2601: 'validword' : local function definitions are illegal
Re: Illegal local function definition
It would be easier to spot the problem if you included main(), but meanwhile, what's:
if ( !validword( temp ) ) //??????????????
bool validword(int word)
{
return ( word >= -9999 && word <= 9999 );
}
Al