函數的默認參數:
1.函數的默認參數必須放在形參的右邊而且在默認形參的右邊不能出現沒有無默認參數的形參
2.如果函數的聲明給出了默認的參數,那麼函數的實現就不能定義默認參
3.聲明成員函數時沒有給出默認的參數,而實現成員函數有默認參數,調用時可能看不到默認參(當函數實現放在前面的時候,可以看到)、
4.因此通常默認參數放在.h聲明中
多態--->重載(overload)
重載的實現原理:函數的名稱粉碎
函數名稱粉碎的查找方法:
在代碼中,聲明一個函數不去實現它,但是在main函數中去調用這個函數,然後編譯、連接檢查代碼,在錯誤的提示裡就能查看到函數的粉碎的名稱。
Lesson 3 An unknown goddess
Some time ago,an interesting discovery was made by archaeologists on the Aegean(adj.愛琴海的;n.)island of Kea.An American team explored a temple which stands in an ancient city on the promontory of Ayia Irini.The city at one time must have been prosperous,for it enjoyed a high level of civilization.Houses--often three storeys high--were built of stone.They had large rooms with beautifully decorated walls.The city was even equipped with a drainage system,for a great many clay pipes were found beneath the narrow streets.
The temple which the archaeologists explored was used as a place of worship from the fifteenth century B.C. until Roman times. In the most sacred room of the temple, clay fragments of fifteen statues were found. Each of these represented a goddess and had, at one time, been painted. The body of one statue was found among remains dating from the fifteenth century B.C. Its missing head happened to be among remains of the fifth century B.C. This head must have been found in Classical times and carefully preserved. It was very old and precious even then. When the archaeologists reconstructed the fragments, they were amazed to find that the goddess turned out to be a very modern-looking woman. She stood three feet high and her hands rested on her hip. She was wearing a full-length skirt which swept the ground. Despite her great age, she was very graceful indeed, but, so far, the archaeologists have been unable to discover her identity....余下全文>>
錯誤提示, 有木有發現 你語法問題 缺個}