LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-17-2006, 06:49 AM   #1
Abulafia_
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Simple problem but couldn't solve


Hi I am a new member , I have problem about compiler.
When I execute my code , it is seen for only one second and I couldn't see the results.What Can I do for this stupid problem?
1-I am using C++ and Dev-C++ , actually the output of any code appears only for a second when it is executed , in a blink of an eye it dissappears.

Last edited by Abulafia_; 06-17-2006 at 09:56 AM.
 
Old 06-17-2006, 07:02 AM   #2
Flesym
Member
 
Registered: Aug 2005
Location: Germany
Distribution: Ubuntu, Debian
Posts: 189

Rep: Reputation: 31
First of all: Welcome!

And second: Give us some more details! -What language are you talking about, which compiler and how do you invoke it; what was the output.
Quote:
When I execute my code , it is seen for only one second and I couldn't see the results
What does this mean? -What "is seen for only one second"? -Any output here?
 
Old 06-17-2006, 07:03 AM   #3
FLLinux
Member
 
Registered: Jul 2004
Location: USA
Distribution: Fedora 9, LFS 6.3, Unbuntu 8.04, Slax 6.0.7
Posts: 145

Rep: Reputation: 15
Same as above, post at the sametime
 
Old 06-17-2006, 07:55 AM   #4
stephenwalter
Member
 
Registered: Jul 2005
Location: india,coimbatore
Distribution: Fedora core 4
Posts: 85

Rep: Reputation: 15
Hi,
I think the problem u r facing is because u might have not added the getch() to the end of your program in c hopefully, so it just displays the o/p and the control returns immideatly.

Regards,
S.Suresh Stephen.
 
Old 06-17-2006, 11:56 AM   #5
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
hehe yea sounds like your running it in windows. Dos box comes up and then disapears again. This is normal.

You can disable this by right clicking on your app and then unchecking exit on program termination or something like that. Sorry havent written anything that runs in dos in a while now.
 
Old 06-18-2006, 04:07 AM   #6
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
Or just run it from a DOS shell directly. Even so .. what is this doing on a LINUX forum?
 
Old 06-18-2006, 04:16 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
There's no problem with this thread in this forum. From the forum description:

The question does not have to be directly related to Linux and any language is fair game.
 
Old 06-18-2006, 05:12 AM   #8
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
Quote:
Originally Posted by Abulafia_
Hi I am a new member , I have problem about compiler.
When I execute my code , it is seen for only one second and I couldn't see the results.What Can I do for this stupid problem?
1-I am using C++ and Dev-C++ , actually the output of any code appears only for a second when it is executed , in a blink of an eye it dissappears.
there are solutions like running it in DOS (whatever), viewing user screen, or just ask for a variable in the end of the code or something :
int i=0;
readln i; (scanf (%d,i)); whatever.


enjoy/
 
Old 06-18-2006, 11:41 AM   #9
Christmas
LQ Newbie
 
Registered: Apr 2006
Location: Romania, Bucharest
Distribution: Kubuntu 6.06 Dapper Drake
Posts: 7

Rep: Reputation: 0
As far as I remember you can use system (pause); or getchar(). Sometimes getchar() is cought by the last read function so maybe try to put two of them. getchar (); getchar ();
 
Old 06-18-2006, 11:44 AM   #10
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
even a delay would help here lol
 
  


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
I need help to solve this problem TheTiger Fedora 1 10-26-2005 01:01 PM
help..how i can solve this problem?// TAAN Linux - General 2 02-16-2005 07:53 AM
Who can help me to solve this problem? Annie0716 Programming 2 08-09-2004 07:59 PM
I don't know how to solve a problem in C nostrum Programming 5 07-20-2004 07:57 AM
The only problem I couldn't solve... Bager Linux - Laptop and Netbook 2 07-21-2003 08:37 AM

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

All times are GMT -5. The time now is 04:26 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