944,117 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2545
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 12th, 2005
0

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

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
geeta is offline Offline
4 posts
since Nov 2005
Nov 12th, 2005
0

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

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
C++ Syntax (Toggle Plain Text)
  1. system("pause" );
statement before the return statement to make the program pause till you press a key.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Nov 12th, 2005
0

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

Quote originally posted by WolfPack ...
you can also use
C++ Syntax (Toggle Plain Text)
  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
Reputation Points: 51
Solved Threads: 4
Posting Pro in Training
JoBe is offline Offline
420 posts
since Sep 2004
Nov 12th, 2005
0

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

Quote ...
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?
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Nov 12th, 2005
0

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

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).
C++ Syntax (Toggle Plain Text)
  1. c++ -- cin.ignore() will wait for user input
  2. or cin.get()
  3.  
  4. c -- getchar()
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Nov 12th, 2005
0

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

Thanks a lot.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Nov 12th, 2005
0

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

Or simply have the user go to a dos prompt before executing the program.
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Nov 12th, 2005
2

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

Quote originally posted by Ancient Dragon ...
system() function takes a lot of time to execute.
So?
Team Colleague
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Rashakil Fol is offline Offline
2,479 posts
since Jun 2005
Nov 12th, 2005
0

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

Quote 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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Nov 13th, 2005
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
geeta is offline Offline
4 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: save an image into a file using c++
Next Thread in C++ Forum Timeline: C++ Program Q





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC