Firstly, you seem to be confused about what the word "void" means.
main(), a(), b() and c() are
functions. The word "void" here is the return type, and indicates that the functions don't return anything.
If you want other functions to have access to variables declared in main, then you need to pass them into those functions as parameters, e.g.:
1 2 3 4 5 6 7 8
|
void a(int i); // Declaration of function called "a", takes int parameter called "i" and doesn't return anything
void main() // main should really return an int, but whatever
{
int myInt = 17;
a(myInt); // Passing the value of myInt into the function
}
|
With arrays, it's slightly more complicated, but the principle is the same.
Basically, you need to go back to your textbook and read up on functions.
(You can also use global variables. But global variables are problematic, and should be avoided wherever possible.)