}
int student::new_group (char* k)
{ int i;
for (i=0;i<6;i++)
{
if ((((i<4)||(i==5))&&((int)(*(k+i))-(int)('0')<10)&&((int)(*(k+i))-(int)('0')>=0))||((*(k+4))=='/')) continue;
return 1;
}
this->group=(char*) malloc (size_info(k));
strcpy(this->group,k);
return 0;
}
void student::new_marks (int* k, int mode=1)
{
int j;
int size=mode*size_info(this->marks); //number of th elements in th array and first position after this elements
int addonsize=size_info(k);
this->marks=(int*) realloc(this->marks,((size+addonsize+1)*sizeof(int)));
for (j=0;j<addonsize;j++)
this->marks[size+j]=k[j];
this->marks[size+j]=0;
}
void student::new_gradute (int k)
{
this->end=k;
}
void student::new_accession (int k)
{
this->begin=k;
this->end=k+student::study_time;
}
void student::update()
{ char c[]=__DATE__;
char b[]="JanFebMarAprMayJunJulAugSepOctNovDec";
int month=0,year;
int b_group;
student* curr=student::l_first;
int k=int(sizeof(c)/sizeof(char))-2; //there is a '\0' symbol at the end of the line, it's not needed for us
//array starts from 0 not 1
while (c[k]!=' ') k--;
year=atoi(c+k);
//now we know the current year!
//what about month?
c[3]='\0';
month=int((unsigned long)strstr(b,c) - (unsigned long)b)/3+1;
//month 'n' year are known!
//cout<<month<<':'<<year; //test a date
while (curr!=NULL)
{
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.