返回一个数组字符? [英] Returning an Array a characters?
问题描述
C ++中不允许这样做吗?我尝试使用MSVC,但我总是收到错误,并且
该函数不再出现在我的课堂视图中。
Is this not allowed in C++? I try in MSVC, but I always get an error, and
the function no longer shows up in my class view.
推荐答案
Jordan Tiona写道:
Jordan Tiona wrote:
这在C ++中是不允许的?我在MSVC中尝试,但我总是收到错误,并且该函数不再出现在我的课堂视图中。
Is this not allowed in C++? I try in MSVC, but I always get an error, and
the function no longer shows up in my class view.
无法计算。 ...需要更多的输入。
Doesn''t compute....need more input.
Jordan Tiona写道:
Jordan Tiona wrote:
这在C ++中是不允许的?我在MSVC中尝试,但我总是收到错误,并且该函数不再显示在我的课堂视图中。
Is this not allowed in C++? I try in MSVC, but I always get an error, and
the function no longer shows up in my class view.
数组是邪恶的。请改用std :: vector或std :: string。
http://www.parashift.com/c++-faq-lit....html#faq-34.1
干杯! --M
Arrays are evil. Use a std::vector or std::string instead.
http://www.parashift.com/c++-faq-lit....html#faq-34.1
Cheers! --M
2005年12月30日星期五10:59:07 -0700 comp.lang.c ++,Jordan Tiona>
< to ******* @ comcast.net>写道,
On Fri, 30 Dec 2005 10:59:07 -0700 in comp.lang.c++, "Jordan Tiona"
<to*******@comcast.net> wrote,
这在C ++中是不允许的?
Is this not allowed in C++?
它不是,也不是按值传递数组作为参数。 />
我认为原因是,如果允许的话,你可能会在没有意识到
错误的情况下进行大量不必要的大量数据复制。
有更好的方法,特别是在C ++中与旧C相比。你想要完成什么
?
It is not, nor is passing an array by value as a parameter.
I think the reason was, if that was allowed you would probably do a
lot of unnecessary copying of huge data without realizing the
mistake.
There are better ways, especially in C++ as compared to old C. What
are you trying to accomplish?
这篇关于返回一个数组字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!