I am trying to read the standard out of another program into an array or string in my C++ program. I need to read each line individually because based on the output depends on what the program will do.
Example output of the other program is:
www.thescripts. com|/|192.168.1.10|7 5.126.163.34|37 281|80|1
www.thescripts. com|/forum/forum129.html|1 92.168.1.10|75. 126.163.34|3680 4|80|1
As you can see the data is separated by a "|"(pipe).
I've been able to get this working in perl, however I need to be able to port it to C++. I've tried and tried but haven't made much success. Any direction would be great.
Also, I'm doing this in Linux... my goal is to use as portable code as possible... system() does not work as it waits for the command to complete before allowing the program to continue...
Thanks,
Jason Bush
Example output of the other program is:
www.thescripts. com|/|192.168.1.10|7 5.126.163.34|37 281|80|1
www.thescripts. com|/forum/forum129.html|1 92.168.1.10|75. 126.163.34|3680 4|80|1
As you can see the data is separated by a "|"(pipe).
I've been able to get this working in perl, however I need to be able to port it to C++. I've tried and tried but haven't made much success. Any direction would be great.
Also, I'm doing this in Linux... my goal is to use as portable code as possible... system() does not work as it waits for the command to complete before allowing the program to continue...
Thanks,
Jason Bush
Comment