[user02@FC4 Lesson11]$ cat -n nochange.cpp
1 #include <iostream>
2 using namespace std;
3
4 void display_values(int a, int b)
5 {
6 a = 1001;
7 b = 1001;
8
9 cout << "The values within display_values are " << a << " and " << b << endl;
10 }
11
12 int main()
13 {
14 int big = 2002, small = 0;
15
16 cout << "Values before function " << big << " and " << small << endl;
17
18 display_values(big, small);
19
20 cout << "Values after function " << big << " and " << small << endl;
21
22 return 0;
23 }
[user02@FC4 Lesson11]$ g++ -o nochange nochange.cpp[user02@FC4 Lesson11]$ ./nochange
Values before function 2002 and 0
The values within display_values are 1001 and 1001
Values after function 2002 and 0
[user02@FC4 Lesson11]$
lesson_11_nochange.cpp, Rev. 2, Last changed on 2005-08-18 06:51, 321 page hits