作者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/m.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