home *** CD-ROM | disk | FTP | other *** search
- // Chap04_3.c
- void changeArgument(int &refI) //just add the ampersand squiggle
- {
- refI = 10; //looks like a normal assignment
- }
- int main()
- {
- int i = 5;
- changeArgument(i); //no change to the call
- //the value of i is now 10
-
- return 0;
- }
-