Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 30th, 2005, 12:12 AM   #1
dfoled
Newbie
 
Join Date: Sep 2005
Posts: 27
Rep Power: 0 dfoled is on a distinguished road
calling a program

can someone tell me how to call a program?
im lost
dfoled is offline   Reply With Quote
Old Sep 30th, 2005, 12:45 AM   #2
L7Sqr
Hobbyist Programmer
 
Join Date: Jun 2005
Location: here
Posts: 144
Rep Power: 0 L7Sqr is an unknown quantity at this point
first you have to know its number....
(sorry, I couldnt resist)

Your question is not very descriptive...
Do you mean from within you program, via a pipe, or just plain 'how do I execute my compiled program'?

Provide more detail and you will get a better answer.
__________________
"...and though our kids are blessed their parents let them shoulder all the blame."
- The Quiet Things That No One Ever Knows [BrandNew]
L7Sqr is offline   Reply With Quote
Old Sep 30th, 2005, 12:48 AM   #3
dfoled
Newbie
 
Join Date: Sep 2005
Posts: 27
Rep Power: 0 dfoled is on a distinguished road
sorry, i meant how do i run a program from within the one i am making
and if you dont mind answering, how do i find the programs number?
dfoled is offline   Reply With Quote
Old Sep 30th, 2005, 3:16 AM   #4
jasper_ferrer
Newbie
 
Join Date: Sep 2004
Posts: 23
Rep Power: 0 jasper_ferrer is on a distinguished road
i'd bet it'd be on the "programs directory listing".

jasper_ferrer is offline   Reply With Quote
Old Sep 30th, 2005, 7:15 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
#include <cstdlib>

...

std::system("yourprogramname.exe");
You use the system function, in cstdlib. It simply executes whatever you want it to.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 30th, 2005, 12:09 PM   #6
dfoled
Newbie
 
Join Date: Sep 2005
Posts: 27
Rep Power: 0 dfoled is on a distinguished road
thnx a lot, that really helped!!!
dfoled is offline   Reply With Quote
Old Sep 30th, 2005, 4:34 PM   #7
snow
Newbie
 
Join Date: Sep 2005
Location: Slovenia
Posts: 17
Rep Power: 0 snow is on a distinguished road
Why does system() work for me in Dev-Cpp (mingw compiler) when i include iostream?
snow is offline   Reply With Quote
Old Sep 30th, 2005, 4:36 PM   #8
nindoja
Programmer
 
Join Date: Jun 2005
Posts: 92
Rep Power: 4 nindoja is on a distinguished road
@snow: because Dev-Cpp automatically includes some header files for you
nindoja is offline   Reply With Quote
Old Sep 30th, 2005, 5:56 PM   #9
dfoled
Newbie
 
Join Date: Sep 2005
Posts: 27
Rep Power: 0 dfoled is on a distinguished road
Ok, i got my program to call programs like cmd, or telnet, but it wont call this other program i made. can someone tell me whats wrong plz?
thnx,
Dfoled
dfoled is offline   Reply With Quote
Old Sep 30th, 2005, 6:55 PM   #10
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 6 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Most likely it's the wrong path. call it with the directory as well... like...

system("c:\\your\\dir\\to\\exe\\here\\whatever.exe");
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC