作者NoStra ()
看板C_and_CPP
标题[问题] function overloading
时间Wed Feb 3 22:11:28 2016
// first
int Func(int &arg){
// ...
}
// second
int Func(int arg){
// ...
}
void
main() {
// remainder
int n = 10;
// which would be called? first or second?
int rtn = Func(n);
// remainder
}
Thank you for giving assistance.
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 36.229.141.7
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1454508691.A.638.html
1F:→ Frozenmouse: have you tried compiling it first? 02/03 23:12
2F:→ tinlans: C++ 的 main 函式传回型别不可以是 void XD 02/04 03:38
3F:→ tinlans: 然後我的意见也是一样,请自己编译过再来问。 02/04 03:40
4F:→ Frozenmouse: 其实我感觉他是来洗文章的 (小声 02/04 16:53