The return types can be the same or different on overloaded functions. You should note that two functions with the same name and parameter list, but different return types, generate a compiler error.
原帖由 langue 于 2008-1-23 19:44 发表
被重载函数的返回类型可以相同也可以不同。需注意的是,假如两个函数的名称与参数列表均一致然而返回类型不同的话,这就是个编译错误。
可以知道,在这里的这两个函数既不属于重载也不属于重置,而是错误 ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |