要求:
1、給出程式的輸出結果(這個太簡單了,試試就知道了~~~)
2、用專業術語解釋為什麼會有這樣的輸出結果(如果方便的話,越詳細越好……)
#include
class boy//男人類
{
public://他敞開胸懷
void LoveYou(float result)
{
cout << "Preety, I love you, marry
me!" << endl;
}
void KissYou(float result)
{
cout <<
"Pretty, you are too sexy, I want to kiss you..." << endl;
}
};
class girl : public boy//上帝說女人是……
{
public://她也敞開胸懷……我什麼都沒看見:)
void LoveYou(int result)
{
cout << "I love you too...But
I am too shy to say..." << endl;
}
void KissYou(float result)
{
cout << "You do what you want..." << endl;
}
};
void main(void)
{
girl pretty;//一個女孩叫pretty
boy handsome;//一個男孩叫handsome
girl *the_pretty_home = &pretty;//女孩說:我不要離開家……不嫁給你(真的?)!
boy
*the_handsome_home = &pretty;//男孩說:來我家吧,我愛你!
////////////////////////////////////////
//----------?????他們在幹什麼呀?請寫出結果-------------
the_handsome_home->LoveYou(52.1f);
the_pretty_home ->LoveYou(52.1f);
the_handsome_home->KissYou(52.1f);
the_pretty_home ->KissYou(52.1f);
////////////////////////////////////////
}