当前位置: 首页>>代码示例>>C++>>正文


C++ Student::display方法代码示例

本文整理汇总了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;
}
开发者ID:zxjcarrot,项目名称:cpp-homework,代码行数:9,代码来源:9.4.3.cpp

示例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;
}
开发者ID:wangjianfei,项目名称:Tony_high_C,代码行数:10,代码来源:virtual.cpp

示例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;
}
开发者ID:osDanielLee,项目名称:ds_workspace,代码行数:10,代码来源:orignal.cpp

示例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;
}
开发者ID:guolilong2012,项目名称:sweets,代码行数:16,代码来源:main.cpp

示例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();
	
}
开发者ID:Rex7,项目名称:c---Demo,代码行数:9,代码来源:privateinheritance.cpp

示例6: main

int main()
{
    Person stu("hello", 1);
    stu.display();

    Student stt;
    stt.display();

    return 0;
}
开发者ID:panzhao,项目名称:cpp_exercises,代码行数:10,代码来源:test.cpp

示例7: main

int main (int argc, char * const argv[]) {
	Name name;
	Student student;
	
	cin >> student;
	
	student.display(cout);
	
    return 0;
}
开发者ID:AlterTiton,项目名称:bcit-courses,代码行数:10,代码来源:main.cpp

示例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;
}
开发者ID:huangzhuo492008824,项目名称:C-plus-plus,代码行数:11,代码来源:main.cpp

示例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;
}
开发者ID:andresvn89,项目名称:30DaysHR,代码行数:13,代码来源:Solution1.cpp

示例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;
}
开发者ID:shubhajeet,项目名称:cpp,代码行数:42,代码来源:student.cpp

示例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;
    }
}
开发者ID:tbhaumik,项目名称:ISE_Tools_FinalAssignment_4_CPPCheck_Tutorial,代码行数:25,代码来源:portability.cpp

示例12: main

int main()
{	
	Student stud;
	stud.display();
	return 0;
}
开发者ID:kaidee,项目名称:kaidee,代码行数:6,代码来源:student.cpp

示例13: main

int main(){
  Student stud; 
  stud.set_value();
  stud.display();
  return 0;
}
开发者ID:wind2013,项目名称:linux_cpp_freshman,代码行数:6,代码来源:main.cpp

示例14: fun

void fun(Student &s){
	s.display();
	s.change(120,98.5);
	s.display();
};
开发者ID:if-zz,项目名称:CPlusLearn,代码行数:5,代码来源:test1.cpp


注:本文中的Student::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。