How would I import the variables from main to a function without passing it to the function? In the example my teacher gave me, he only passed 3 items to the function, but used variables from the main in the function without passing it and did not declare them in the function. How is this possible?
very rough example:
Code:
void example(stuff, stuff2, stuff3)
{
blah;
blah2=stuff;
blah3=hello;
hello = stuff;
}
void main()
{
blah;
blah2;
char hello;
int stuff, stuff2, stuff3;
hello = blah;
example(stuff, stuff2, stuff3);
}