how to run simple c++ prog from another system?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2005
Posts: 4
Reputation: geeta is an unknown quantity at this point 
Solved Threads: 0
geeta geeta is offline Offline
Newbie Poster

how to run simple c++ prog from another system?

 
0
  #1
Nov 12th, 2005
Hi,

i hve asimple c++ prog written in vc++ editor.I am able to run this in my system when i deploy it in another system which doesn't hve vc++ environment its not working the exe just closes...

can anyone just tell me how to deploy the exe into another system.

is the build in debug mode creates a problem?


please help

thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: how to run simple c++ prog from another system?

 
0
  #2
Nov 12th, 2005
For a simple C++ program you should be able to do it even when Visual Studio is not installed in the other machine. Since you have mentioned it as simple C++ program, I assume it is a console program and that you have forgotten to include a cin statement at the end of the program. This makes the output window to close immediately after it finished its operation.

you can also use
  1. system("pause" );
statement before the return statement to make the program pause till you press a key.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: how to run simple c++ prog from another system?

 
0
  #3
Nov 12th, 2005
Originally Posted by WolfPack
you can also use
  1. system("pause" );
statement before the return statement to make the program pause till you press a key.
I thought Ive read on several occasions that this should be avoided since it is bad programming
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: how to run simple c++ prog from another system?

 
0
  #4
Nov 12th, 2005
I thought Ive read on several occasions that this should be avoided since it is bad programming
If that is true, accept my appologies. Why is it bad?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: how to run simple c++ prog from another system?

 
0
  #5
Nov 12th, 2005
system() function takes a lot of time to execute. There are better ways to do that which do not use cmd.com (or command.com).
  1. c++ -- cin.ignore() will wait for user input
  2. or cin.get()
  3.  
  4. c -- getchar()
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: how to run simple c++ prog from another system?

 
0
  #6
Nov 12th, 2005
Thanks a lot.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: how to run simple c++ prog from another system?

 
0
  #7
Nov 12th, 2005
Or simply have the user go to a dos prompt before executing the program.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,044
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: how to run simple c++ prog from another system?

 
0
  #8
Nov 12th, 2005
Originally Posted by Ancient Dragon
system() function takes a lot of time to execute.
So?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: how to run simple c++ prog from another system?

 
0
  #9
Nov 12th, 2005
Originally Posted by Rashakil Fol
So?
system("cls") is non-standard and doesn't work across operating systems -- for examp unix uses system("clear"), and I suppose apple uses something else. If you want to write ANSI C or C++ then you must stay clear of system() function. But you can ignore that little detail when writing small example programs for yourself that you never indend for anyone else to see.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 4
Reputation: geeta is an unknown quantity at this point 
Solved Threads: 0
geeta geeta is offline Offline
Newbie Poster

Re: how to run simple c++ prog from another system?

 
0
  #10
Nov 13th, 2005
its not a win32 console app. with simple empty application...no not that...
i actually started this prog by selecting a C++ source filefrom files section in the wizard...later compiled the prog it asked tocreatethe workspace sodid taht... prog worked fine its in debug mode... as its a c++ source file the moment i created and built the prog its in debug mode...
wheni deploy it in another sys which doesn't have VS or any other .net or VC++ or vB installed.. its giving problemit just closes doen't give the o/p even i hve set the puse aslobut no luck plz help
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC