DigitalPython
Programmer
I use Red Hat Linux and I use the gcc/c++ compiler that came with it. When I want to write a program that uses the system, I use the syscall.h header file.<br><br>For example, to see how many lines in a file:<br> <font color=red><FONT FACE=monospace>system("wc -l /etc/passwd"</font></font><br><br>The output to the screen would be a number. <b>How would I set that number to a integer value in C++?</b><br>I have tried things like:<br> <font color=red><FONT FACE=monospace>int a;</font></font><br> <font color=red><FONT FACE=monospace>a=system("wc -l /etc/passwd" </font></font><br><br>but that doesn't help at all. I know that that calls a system command, but there should be a way to set a system to response to a variable. Please tell me how to do this or supply a little code that shows how its done. THANKS.<br>