home *** CD-ROM | disk | FTP | other *** search
- // Chap12_7.cpp
- #include <iostream.h>
- #include <string.h>
- class DoNothing
- {
- public:
- DoNothing(int initial)
- {
- cout << "DoNothing constructed with a value of "
- << initial
- << "\n";
- }
- };
-
- void fn(int i)
- {
- static DoNothing dn(i);
- cout << "In function fn with i = " << i << "\n";
- }
-
- int main()
- {
- fn(10);
- fn(20);
- return 0;
- }
-
-