C++第三课(2013.10.03 ),2013.10.03
C++第三课(2013.10.03 ),2013.10.03
函数的默认参数:
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....余下全文>>
错误提示, 有木有发现 你语法问题 缺个}
下一篇: MySQL中数据表操作详解_MySQL