本文整理汇总了C++中Student::display方法的典型用法代码示例。如果您正苦于以下问题:C++ Student::display方法的具体用法?C++ Student::display怎么用?C++ Student::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::display方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main () {
Student stud(101, 78.5);
Student * p = &stud;
p->display();
p->change(101, 80.5);
p->display();
return 0;
}
示例2: main
int main(int argc, const char *argv[])
{
Student stud1(1001,"Li",87);
Graduate grad1(2001,"Wang",98.5,560);
Student *pt = &stud1;
pt->display();
pt = &grad1;
pt->display();
return 0;
}
示例3: main
int main()
{
Student stud1(1001,"Li",87.5);
Graduate grad1(2001,"Wang",98.7,343);
Student *pt = &stud1;
pt->display();
pt = &grad1;
pt->display();
return 0;
}
示例4: main
int main(void)
{
Student *student = new Student("XiaoMing", 12, 99);
student->display();
Person *p = (Person *)student;
p->display();
delete student;
Person *person = new Person("XiaoHua", 11);
person->display();
Student *s = (Student *)person;
s->display();
delete person;
return 0;
}
示例5: main
int main()
{
Student s;
//if we uncomment the below statement after compiling will give erro that method is inaccessible
// s.read_data("regis",2)
s.set_data("our lady of good counsel high school",216478,"regis charles",22);
s.display();
}
示例6: main
int main()
{
Person stu("hello", 1);
stu.display();
Student stt;
stt.display();
return 0;
}
示例7: main
int main (int argc, char * const argv[]) {
Name name;
Student student;
cin >> student;
student.display(cout);
return 0;
}
示例8: main
int main(void)
{
Student s(20, 100, "XiaoWang");
s.display();
Student *ps = new Student(16, "xiaowang", 100);
ps->display();
delete ps;
return 0;
}
示例9: main
int main() {
string firstName, lastName;
int score, phone;
cin >> firstName;
cin >> lastName;
cin >> phone;
cin >> score;
Student *stu = new Grade(firstName, lastName, phone, score);
stu->display();
Grade *g = (Grade*)stu;
cout << "\nGrade: " << g->calculate();
return 0;
}
示例10: main
int main()
{
ofstream data;
data.open("Student.dat",ios::out|ios::binary);
char name[20], id[10], department[20], address[20];
char ans;
do
{
cout << "Enter Student information" << endl;
cout << "Name: ";
cin >> name;
cout << "Id: " ;
cin >> id;
cout << "Department: " ;
cin >> department;
cout << "Address: " ;
cin >> address;
Student newStudent(name,id,department,address);
data.write(reinterpret_cast<char *>(&newStudent),sizeof(newStudent));
cout << "Do you want to continue adding student data y/n";
cin >> ans;
}
while(ans == 'y');
data.close();
ifstream info;
info.open("Student.dat",ios::in|ios::binary);
while(!info.eof())
{
Student newStudent;
info.read(reinterpret_cast<char *>(&newStudent),sizeof(newStudent));
if (info)
newStudent.display();
}
info.close();
return SUCCESS;
}
示例11: main
//#endif
int main()
{ Cohort cohort;
ifstream infile;
infile.open("a5.txt"); // student names and marks
assert (! infile.fail());
int m, c, s;
string nm;
while(infile >> m >> c >> s)
{ getline(infile, nm); // Names have embedded spaces
nm = nm.substr(3); // Skip leading spaces
Student st(nm, m, c, s);
cohort.insert(st);
}
ifstream queryfile;
queryfile.open("queries.txt"); // names to look for
assert (! queryfile.fail());
string query;
while(getline(queryfile, query))
{ Student st = cohort.find(query);
if (st.getname().length() > 0)
st.display();
else cout << query << " not there" << endl;
}
}
示例12: main
int main()
{
Student stud;
stud.display();
return 0;
}
示例13: main
int main(){
Student stud;
stud.set_value();
stud.display();
return 0;
}
示例14: fun
void fun(Student &s){
s.display();
s.change(120,98.5);
s.display();
};