摘要: 出现在作用域中的两个函数,如果具有相同的名字而形参表不同,则称为重载函数。重载函数在作用域方面特别要注意:string init();// the name init has global scopevoid fcn(){int init = 0;//init is local and hides global initstring s = init();//error: global init is hidden}上面 的函数里面的fcn()函数就覆盖了全局函数init();再看下例:void print(const string &);void print(double );//o 阅读全文
posted @ 2011-06-10 19:00 拿枪的程序员 阅读(296) 评论(0) 推荐(0) 编辑