The way you avoid them in future is by not writing so much code in between pressing compile.
Typing in 100's of lines, then getting hundreds of errors is not the way to go
Posting the whole mess on a message board isn't the way to go either.
Code:
void my_new_func ( int a, char *b ) {
}
I've just added two lines to a program, I can now press compile and if all is well, it will compile.
Code:
void my_new_func ( int a, char *b ) {
for ( int i = 0 ; i < a ; i++ ) {
}
}
I can press compile again, and it will still compile. If it doesn't, you examine the for loop you tried to add.
void my_new_func ( int a, char *b ) {
for ( int i = 0 ; i < a ; i++ ) {
cout << b << endl;
}
}
Wow, the function is complete and it compiles.
The point being, if you've only added a few lines and you now have a new error, you've got a damn good idea that the new problem is with the few lines you just added.
> error 2-5 is a local funct. are illegally defined
Almost certainly, the function which is before the first "local" function is missing a closing brace