LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2005, 06:15 PM   #1
audibel
Member
 
Registered: Oct 2004
Distribution: Debian Sarge
Posts: 177

Rep: Reputation: 30
Running programs from a C++ program...


I'm a newbie to C++, but was wondering if and how it might be possible to run programs from a C++ program... Is it a difficult task? Or maybe just take information from a program... or find $HOMEDIR or anything useful... I've got basic concepts, I'm looking to make some practical use out of them. Any pointer in the right direction would be appreciated. I just feel sorta bummed doing the same old reading and writing to text files and savings account and enter data print data, blah blah, I never seem to get past that point when it comes to programming because I don't really know what direction to go.
 
Old 03-08-2005, 07:33 PM   #2
Adony
Member
 
Registered: Apr 2004
Location: Portugal
Distribution: Gentoo 2004.2 - working on LFS 6
Posts: 126

Rep: Reputation: 15
Note:

To run a program from your program you can use the calls system() (man system )and the exec() family of functions (man 3 exec).

To make your programs 'talk' with each other you can see the pipe() (man pipe ), dup() (man dup) . It could also be interessing to take a look at the fork()

Note that what as said above could be used within a C program but I think that you should be able to use it with your C++ programs too .

Hope that helps ... and have fun
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running programs jdarvwill Linux - Software 3 10-05-2005 10:15 PM
running programs The Oate Debian 3 08-25-2005 01:17 PM
Running Programs Slayer097 Linux - Newbie 3 02-23-2005 04:43 PM
HElP Running Programs pbrian17 Linux - Newbie 2 10-09-2004 03:03 AM
Running programs OtisLinux Linux - Software 13 01-22-2004 04:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration