Hi I was just wondeing if it was possible to create a variable inside a function but give it a global scope.

For example...
Code:
int main()
{

funtion();

x = 2;
}
Code:
void function()
{
int x;
}
I know the easy way would be to just put it in main, but this is more for my curiosity as such