A global variable is a variable that is not defined inside a function and anything can access it (which is why you shouldn't them 98% of the time).
1 2 3 4 5 6 7 8 9 10 11 12 13
int x = 5; //Global Variable
void Func()
{
int y = 6; // Local Variable
// Can access x or y, but not z directly
}
int main()
{
int z = 7; // Local Variable
// Can access x or z, but not y directly
}
Q2 answer seems correct but I would get a second opinion, I haven't looked into the technical definition for passing by reference, so there might be some catch.