本文整理汇总了C++中Human::IntroduceSelf方法的典型用法代码示例。如果您正苦于以下问题:C++ Human::IntroduceSelf方法的具体用法?C++ Human::IntroduceSelf怎么用?C++ Human::IntroduceSelf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Human
的用法示例。
在下文中一共展示了Human::IntroduceSelf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
#if 0
//9.1.2
double Pi = 3.1415; // a double declared as a local variable(on stack)
Human Tom; // An object of class Human declared as a local variable
int * pNumber = new int; // an integer allocated dynamically on free store
delete pNumber; // de-allocating the memory
Human * pAnotherHuman = new Human(); // dynamically allocated Huaman
delete pAnotherHuman; // de-allocating memory allocated for a Human
#elif 1
// 9.1.3
Human Tom; // an instance of Human
Tom.DateOfBirth = "1970";
Tom.IntroduceSelf();
Human * pTom = new Human();
pTom->DateOfBirth = "1970";
(*pTom).IntroduceSelf();
pTom->IntroduceSelf();
delete pTom;
#else
// 9.1.4
Human Tom;
Human *pTom = &Tom;
pTom->DateOfBirth = "1970";
pTom->IntroduceSelf();
#endif
return 0;
}