Is it possible to change argv or do I need to create an adjusted copy of it?

后端 未结 8 867
长情又很酷
长情又很酷 2020-11-29 09:01

My application has potentially a huge number of arguments passed in and I want to avoid the memory of hit duplicating the arguments into a filtered list. I would like to fi

8条回答
  •  有刺的猬
    2020-11-29 09:38

    The C99 standard says this about modifying argv (and argc):

    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.

提交回复
热议问题