C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I execute a system command in c++

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
silverburgh.meryl@gmail.c
Guest





PostPosted: Thu May 17, 2007 9:10 am    Post subject: How can I execute a system command in c++ Reply with 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.
Back to top
John Harrison
Guest





PostPosted: Thu May 17, 2007 9:11 am    Post subject: Re: How can I execute a system command in c++ Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.