const char * argv [英] const char* argv
问题描述
为什么不是:
int main(int argc,char * argv []){/ * ... * /}
as:
int main(int argc,const char * argv [])
我假设你不能编辑字符串argv指向。 。 。对吗?
-JKop
Why isn''t:
int main(int argc, char* argv[]) { /* ... */ }
as:
int main(int argc, const char* argv[])
I assume you can''t edit the strings which argv points to. . . right ?
-JKop
推荐答案
" JKop" < NU ** @ NULL.NULL>写在消息>
"JKop" <NU**@NULL.NULL> wrote in message >
为什么不是:
int main(int argc,char * argv []){/ * ... * /}
as:
int main(int argc,const char * argv [])
我假设你不能编辑argv指向的字符串至。 。 。对吗?
Why isn''t:
int main(int argc, char* argv[]) { /* ... */ }
as:
int main(int argc, const char* argv[])
I assume you can''t edit the strings which argv points to. . . right ?
编号这是C99的报价 -
"参数argc和argv以及argv指向的字符串数组
应该可以由程序修改,并在程序
启动和程序终止之间保留它们最后存储的值
。
Sharad
No. This is a quote from C99 -
"The parameters argc and argv and the strings pointed to by the argv array
shall be modifiable by the program, and retain their last-stored values
between program
startup and program termination."
Sharad
不。这是C99的引用 -
The参数argc和argv以及argv
数组指向的字符串应该可由程序修改,并在程序启动和程序终止之间保留它们最后存储的值。
No. This is a quote from C99 -
"The parameters argc and argv and the strings pointed to by the argv
array shall be modifiable by the program, and retain their last-stored
values between program
startup and program termination."
这是一个真正的问题:与C ++有什么关系?我认为C99
是某种...... C或C ++的其他方言。 。 。 ?
-JKop
This is a genuine question: What has that to do with C++? I take it that C99
is some sort of... other dialect of C or C++ . . . ?
-JKop
" JKop" < NU ** @ NULL.NULL>在消息中写道
"JKop" <NU**@NULL.NULL> wrote in message
否。这是来自C99的引用 -
参数argc和argv以及argv指向的字符串>数组应该可由程序修改,并在程序启动和程序终止之间保留它们最后存储的值。
这是一个真正的问题:有什么与C ++有关?我认为
No. This is a quote from C99 -
"The parameters argc and argv and the strings pointed to by the argv
array shall be modifiable by the program, and retain their last-stored
values between program
startup and program termination."
This is a genuine question: What has that to do with C++? I take it that
C99是某种...... C或C ++的其他方言。 。 。 ?
C99 is some sort of... other dialect of C or C++ . . . ?
Nah ...实际上C ++基于C90。您可以在C ++标准中找到对C子条款
的引用。 C99是C标准的最新版本,我从这个引用中引用了b $ b。 AFAIK C ++继承它的方式与C在这个
方面的方式相同,但不太确定。
Sharad
Nah...C++ is based on C90 actually. You can find references to C subclauses
in the C++ Standard. C99 is the more recent revision of the C Standard, I
made a quote from that. AFAIK C++ inherits it the same way as C does in this
regard, not very sure though.
Sharad
这篇关于const char * argv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!