473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Console flashes when ran.

Hey,
I am an extreme newbie and when I run my code after compiling it, the cmd just flashes and closes. Now, I know that it is flashing because I haven't paused it but using script like getch() that is prior to return; will not work for me as this will stop the script all too soon. So far this is my code:


#include <iostream>
using namespace std;
int change(int,int,int);


int main() {
int x =34, y=45, z=67, sum = 0;
sum = change(x,y,z);
cout << sum << endl;
return 0;
}

int change(int x, int y, int z){
int sum;
cout << x << " " << y << " " << z << endl;
sum = (x+y+z);

return sum;
}


At the moment I am using Dev C++ 4.9.9.2 .
Jan 10 '12 #1
1 1767
whodgson
542 512MB
insert system("pause"; before return 0;
Jan 11 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mark Allison | last post by:
Hi, I have an application that I want to be to run in Console mode and GUI mode. If no params are entered, I want the GUI fired up, if params are entered, then go into console mode. I believe...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
0
by: Kevin | last post by:
Hello, all experts: May I ask you some questions? First, i'm programming a software of auto-authentication by using VB.NET tool. This software's functions is similar to do the account login...
0
by: Mark | last post by:
Hello. Here is a simple frameset with two menu choices and a target frame which has a background image. The documents that are displayed in the target frame have their background defined as...
0
by: Helge Lenuweit | last post by:
Hello, I am trying to put together an application that (1) shows Console.WriteLine() output when launched from within a console window (that is, from the command prompt) but that (2) **does not...
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
2
by: stevie.greenslade | last post by:
'Lo all. I have a simple question I'd like help on. :] How, if at all, would one go about suppressing the console window that flashes up when you make at system() call in your C++ program? I'm...
3
by: Dave S | last post by:
Hello Everyone, I have a form in a multi-user database that flashes when the form is opened. This is a failr involved form that contains header information along with a continous subform. ...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
2
by: varunkumarid | last post by:
Hi to all I have one C# Console Application in Server. If suppose the Server is switch off by some reason and somebody switch on the server means i have to rerun the application through the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.