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

后端 未结 8 1056
长情又很酷
长情又很酷 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:48

    Empirically, functions such as GNU getopt() permute the argument list without causing problems. As @Tim says, as long as you play sensibly, you can manipulate the array of pointers, and even individual strings. Just don't overrun any of the implicit array boundaries.

提交回复
热议问题