search

Home  >  Q&A  >  body text

c++ 调用shell 并执行任务

开发项目时,老会 cd Desktop/demo
然后运行相关命令 ,比如 compass compile
如何写一个用c++写一个exec自动执行??

PHP中文网PHP中文网2767 days ago828

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 14:58:22

    Just call it through system in C++.
    Reference: http://www.cplusplus.com/refe...

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:58:22

    It is recommended to use scripts to complete this kind of flexible batch processing tasks, because many configurations will change, such as the name and path of the folder. If you use C++, you need to recompile if you modify it. Using a script language can be more flexible according to the To adjust according to changes in tasks, it is recommended to use Python, Node, and Bash scripts.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:58:22

    It is recommended to call compiled language in script language, otherwise you are likely to lose both development efficiency and static language performance.

    reply
    0
  • Cancelreply