You are not logged in.
I am writing a program and i decided for input/output it would be best to allow for custom commands. I have written a config file and defined a series of commands (just echo, etc) and call these within the program using system(). The problem is that i need to get input from these commands. I tried using "read ANSWER" and then getenv("ANSWER") but this returns a null string. What is the best method to do this?
Last edited by BennyBolton (2012-08-17 07:10:59)
HP DV6 + Arch + Openbox
Offline
Use "popen()" instead of "system()". Even better, avoid subprocesses and use C++ libraries instead. I can't see any reason why one would call echo from C++…
Last edited by lunar (2012-08-17 06:59:43)
Offline
Thank you for the reply! This should do the trick
HP DV6 + Arch + Openbox
Offline