2

I didn't really know how to even look for the solution for this one. My problem is, how to execute system commands in c++ using function system(); but for more arguments(Come on it sounds awful). Let me explain: Try for example to type something like this in termianl:

lynx www.somewebsiteidunnowhatever.com -get_data

And here we go, empty line asking us for input. You can type something like:

name=travis&age=45&hobby=football
---

After that we would see some result. Now I can't manage how to achievie such behaviour with system(); My c++ script stop responding when that empty line occures. Please help...

Braiam
  • 69,112

1 Answers1

5

I suggest you use the format such as following format.

system("echo \"name=travis&age=45&hobby=football\" | lynx www.somewebsiteidunnowhatever.com -get_data");

using pipe(|), you can give a any command's output to any commands as it's input.

xiaodongjie
  • 2,874