请问你们能不能帮一下我看一下我的这些VC++程序的各行语句的作用是什么啊?
这些VC++程序的各行语句的作用是什么啊?我对C++真的看不懂,可是我是学计算机的,我真的很想学,加上现在又要写这一程序的论文,说出各行语句的作用,能实现什么……请问有没有人能帮助我啊!以下只是我负责的一小部分#include"console.h"
#include"student.h"
#include"studentui.h"
CStudentUI theUI;
CStudentFile theFile("student.dat");
// 定义命令函数
void DoAddRec(void);
void DoDelRec(void);
void DoListAllRec(void);
void DoFindRec(void);
void main()
{
const int nItemNum=7;
char*strItem[nItemNum]={"Add a student data record",
"Delete a student data record",
"_",
"List all data records",
"Find a student data record",
"_",
"Exit" };
theUI_SetOptionsTitle("Main Menu");
for(;;)
{
int nIndex=theUI_GetOptions(strItem,0,0,nItemNum);
switch(nIndex)
{
case 0:
DoAddRec(); break;
case 1:
DoDelRec(); break;
case 2:
DoListAllRec(); break;
case 3:DoFindRec(); break;
case 4:
return;
}
}
}
void DoAddRec(void)
{
CStudentRec rec;
if(theUI.InputStuRec(rec))
{
theFile.Add(rec);
DolistAllRec();
}
}
void DoDelRec(void)
{
CStudentRec rec;
char strID[80],str[80]="No find the record of";
strcpy(strID,theUI_InputBox("Input Deleted Student ID",0,0));
if(strID)
{
int nIndex=theFile.Seek(strID,rec);
if(nIndex>=0)
{
theFile.Delete(strID);DoLisAllRec(); }
else
{
strcat(str,strID);
strcat(str,"!");
theUI.MessageBox("Notice",str,1);
}
}
}
void DoListAllRec(void)
{
int nCount=theFile.GetRecCount();
CStudentRec*stu;
stu=new CStudentRec[nCount];
theFile.GetStuRec(stu);
theUI.DispStuRecs(stu,nCount);
delete[nCount]stu;
}
void DoFindRec(void)
{
CStudentRec rec;
char strID[80],str[80]="No find the record of";
strcpy(strID,theUI._InputBox("Input Finded Student ID",0,0));
if(strID)
{
int nIndex=theFile=theFile.Seek(strID,rec);
if(nIndex>=0)
theUI.DispStuRecs(&rec,1);
else
{
strcat(str,strID);strcat(str,"!");
theUI._MessageBox("Notice",str,1);
}
}
}