本文整理汇总了C++中Person::aboutMe方法的典型用法代码示例。如果您正苦于以下问题:C++ Person::aboutMe方法的具体用法?C++ Person::aboutMe怎么用?C++ Person::aboutMe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::aboutMe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Person * p = new Student;
Student * s = new Student;
Student * gs = new GradStudent;
Person * ps = new GradStudent;
p->aboutMe();
s->aboutMe();
gs->aboutMe();
ps->aboutMe();
delete p;
delete s;
delete gs;
delete ps;
return 0;
}
示例2: main
int main()
{
Person *p = new Student();
p->aboutMe();
p->addCourse("Math");
delete p;
return 0;
}
示例3: main
int main()
{
//Student *s = new Student();
Person *p = new Student();
//s->aboutMe();
p->aboutMe();
p->addCourse("Advance Operating System");
//delete s;
delete p;
cout << sum(4) << endl;
cout << sum(1,2) << endl;
int *ptr = new int;
*ptr = 3;
cout << ptr << endl;
cout << *ptr << endl;
int a = 7;
int &b = a;
b = 12;
cout << a << endl;
ofstream file;
file.open("testFile.txt");
file << "This line will be written on the first line in the file.\n";
file << "This line will be written on the second line in the file.";
file.close();
int lines;
cout << "How many lines from end : ";
cin >> lines;
getLastKLines("4.4.cpp", lines);
return 0;
}