home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP12
/
CHAP12_7.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-02
|
401b
|
28 lines
// 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;
}