For example, I have a script ./helloworld.sh
I would like to call it in C++, how do I do that? Which library can be used?
try
system("./helloworld.sh");
If you just want to run it (and nothing else)
system("./helloworld.sh");
If you need to get the stdin/stdout then you need to use popen()
FILE* f = popen("./helloworld.sh","r");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With