Run this for me please
I dont have access to C++ right now. Can somebody run this program and tell what the results are please.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
void f1(int);
int v1, v2=9;
int main(void)
{
f1(3);
f1(5);
}
void f1(int x)
{
static int v2;
v1++;
v2 = v2 + x;
cout << v1 << " " << v2 << endl;
}
|
Also explain what the static thing does it you can.
Thanks
Topic archived. No new replies allowed.