-   Programming (
-   -   commands stored into variables? (

benne 11-15-2004 05:23 AM

commands stored into variables?
Hoi there!

How do I let my program (c++) exucte a unix command (e.g. cat /proc/cpuinfo | grep "model name")? I need to collect some information about the computer it is running on, and play around with it..

I can imangine this will be very simple, as it seems to be..


Kess78 11-15-2004 05:27 AM

C, C++, Java, etc... can work on files...
I dont remember the C++ function that open files but it's something like fopen().
You dont need to execute a command, work directly on the file...


Bye Kess...

CroMagnon 11-15-2004 08:20 PM

The C function is system() - you should be able to call it from C++ also.

All times are GMT -5. The time now is 12:01 PM.