StudentId( )
{
value = ++nextStudentId ;
cout << "Присвоение id " << value << endl ;
}
protected :
_________________
204 стр. Часть 3. Введение в классы
int value ;
} ;
class Student
{
public :
Student( char* pName )
{
cout << "Конструктор Student( " << pName
<< " )" << endl ;
strncpy( name , pName , MAXNAMESIZE ) ;
name[ MAXNAMESIZE - 1 ] = '\0' ;
semesterHours = 0 ;
gpa = 0.0 ;
}
/* ...прочие открытые члены... */
protected :
char name[ MAXNAMESIZE ] ;
int semesterHours ;
float gpa ;
StudentId id ;
} ;
int main( int argcs , char* pArgs[ ] )