您的位置:首页 > 编程语言 > C语言/C++

原来c++函数不能返回数组啊

2013-10-08 15:01 260 查看
今天才知道c++函数不能返回数组,真实水,想要完成相同效果只能用指向数组的指针或数组引用。

c++11 增加了额新功能,就是形参列表initializer_list<T> lst. 可以传递不知数目的参数啊 有木有


重新定义函数是合法的,但在给定的作用域内,每个函数中参数只能被默认赋值一次

Just as with arrays, we cannot define parameters of function type but can have a parameter that is a pointer to function. As with arrays, we can write a parameter that looks like function types, but it will be treated as a pointer.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: