home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP16
/
CHAP16_1.CPP
next >
Wrap
C/C++ Source or Header
|
1996-09-02
|
406b
|
25 lines
// Chap16_1.cpp
#include <iostream.h>
#include <string.h>
class Student
{
public:
static int number()
{
return noOfStudents;
}
//...other stuff the same...
protected:
char name[40];
static int noOfStudents;
};
int Student::noOfStudents = 0;
int main()
{
Student s;
cout << s.number() << "\n";
cout << Student::number() << "\n";
return 0;
}