| View previous topic :: View next topic |
| Author |
Message |
silverburgh.meryl@gmail.c Guest
|
Posted: Thu May 17, 2007 9:10 am Post subject: How can I execute a system command in c++ |
|
|
Hi,
I am writing a C++ program under linux.
Can you please tell me how can I execute a System command in c++?
Kind of like System.exec() in Java?
Thank you. |
|
| Back to top |
|
 |
John Harrison Guest
|
Posted: Thu May 17, 2007 9:11 am Post subject: Re: How can I execute a system command in c++ |
|
|
silverburgh.meryl (AT) gmail (DOT) com wrote:
| Quote: | Hi,
I am writing a C++ program under linux.
Can you please tell me how can I execute a System command in c++?
Kind of like System.exec() in Java?
Thank you.
|
#include <stdlib.h>
system("your command here ");
'kind of' like System.exec() is the right way to describe it. Linux has
O/S functions like exec and fork, which might be more appropriate, but
these are not standard C++.
john |
|
| Back to top |
|
 |
|