Parse string into argv/argc

前端 未结 13 897
生来不讨喜
生来不讨喜 2020-11-28 07:45

Is there a way in C to parse a piece of text and obtain values for argv and argc, as if the text had been passed to an application on the command line?

This doesn\'

13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 08:04

    I'm surprised nobody has provided the simplest answer using standard POSIX functionality:

    http://www.opengroup.org/onlinepubs/9699919799/functions/wordexp.html

提交回复
热议问题