本文整理汇总了C++中People::sayHello方法的典型用法代码示例。如果您正苦于以下问题:C++ People::sayHello方法的具体用法?C++ People::sayHello怎么用?C++ People::sayHello使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::sayHello方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char * argv[]) {
People *p = new People();
p->sayHello();
delete p;
return 0;
}
示例2: main
int main(int argc, const char * argv[]) {
// insert code here...
People *p =new People();
p->sayHello();
delete p;
return 0;
}
示例3: main
int main() {
People *p = PeopleInit(ObjectCreate(People),20);
p->sayHello();
ObjectDelete(p);
return 0;
}
示例4: main
int main(int argc, const char * argv[]) {
// insert code here...
People *p =new People( );
p->sayHello();
// std::cout << "Hello, World!\n";
delete p;
return 0;
}
示例5: main
int main(int argc, const char * argv[]) {
// 用命名空间方式来访问类
// jikexueyuan:命名空间
// jikexueyuan::People *p = new jikexueyuan::People();
People *p = new People();
p->sayHello();
//销毁对象
delete p;
return 0;
}
示例6: main
int main(int argc, const char * argv[]) {
//类对象
People *p = new People();
//类方法
p->sayHello();
//销毁对象
delete p;
//C语言的分配内存和销毁内存的关键字
//malloc(sizi_t)
//free(void *)
return 0;
}
示例7: main
int main(int argc, const char * argv[]) {
People *p = new Man(20);
//People *p = new People(20,1);
// Let father point to sun's shili.
// Use the point to call the function with the
// same name in father's
p->sayHello();
p->eat();
return 0;
}
示例8: main
int main(int argc, const char * argv[])
{
// People * p = new People();
// p->sayHello();
// delete p;
People* m = new Man(20);
m->sayHello();
m->eat();
printf("age : %d\n",m->getAge());
delete m;
std::cout << "Hello, World!\n";
return 0;
}