I have a file of 14 functions. I know I need an extern array of 14 bools. If something goes wrong in one of these functions, the function should modify its respective array member to false. I want the main program to be able to access the array members to verify if upon execution of one of these functions the array number of that function became false (function alerted something went wrong).
I know I can do this easier other ways, but I have to do it with extern and I cannot get the linkage to work because I cannot understand it well enough.
There will also be a utility function ran at the start of the main program that will set all array members to true by default:
void init_flags()
{
int i;
for (i = 0; i < NFLAGS; i++)
exit_flags[i] = true;
}
Any tips on where and how I declare the extern variable would be greatly appreciated.