-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto.cpp
26 lines (26 loc) · 833 Bytes
/
auto.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;
void oil(int x);
int main()
{
int texas = 31;
int year = 2011;
cout << "In main(), texas = " << texas << ", &texas = " << &texas << endl;
cout << "In main(), year = " << year << ", &year = " << &year << endl;
oil(texas);
cout << "In main(), texas = " << texas << ", &texas = " << &texas << endl;
cout << "In main(), year = " << year << ", &year = " << &year << endl;
return 0;
}
void oil(int x)
{
int texas = 5;
cout << "In oil(), texas = " << texas << ", &texas = " << &texas << endl;
cout << "In oil(),x = " << x << ", &x = " << &x << endl;
{
int texas = 113;
cout << "In block, texas = " << texas << ", &texas = " << &texas << endl;
cout << "In block, x = " << x << ", &x = " << &x << endl;
}
cout << "Post-block texas = " << texas << ", &texas = " << &texas << endl;
}