Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Thu Jan 08, 2009 2:42 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Stopping executing script...
PostPosted: Mon Sep 29, 2008 4:31 pm 
Offline

Joined: Sat Sep 06, 2008 5:06 pm
Posts: 40
Hello, I don't have much knowledge, but I am still learning. (Sorry for imperfect English...)
Script:
Quote:
// pattern.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


#include <iostream>
using namespace std;

int main ()
{
int i;
cout << "Hello World!" << ".\n";
cout << "Please enter the text: ";
cin >> i;
cout << ".\n";
cout << "You have entered: " << i;
return 0;
}

This was compiled in visual cpp 2008. After execution when I input variables i value, the window disappears and I didn't make to read what I have written. I need to know the best ways to stop window from disappearing.
Hope someone could help me...


Top
 Profile  
 
 Post subject: Re: Stopping executing script...
PostPosted: Mon Dec 15, 2008 7:09 pm 
Offline

Joined: Tue Mar 27, 2007 2:07 pm
Posts: 42
Location: St Helens, England
Well I don't know alot of cpp but my understanding is that any cpp compiler will use both cpp & c syntaxs, in c you would put.


//Clears anything in keyboard input so you dont get any input signals
//passed over from any other part of the program
//The printf is just so that anyone else remembers they have
//to press enter to continue.
printf("Please press 'Enter' to continue
fflush(stdin);
getc();

//Just place it just before the return 0; command

return 0;
}

_________________
"Simplicity Is An Art"


Top
 Profile  
 
 Post subject: Re: Stopping executing script...
PostPosted: Mon Dec 15, 2008 7:12 pm 
Offline

Joined: Tue Mar 27, 2007 2:07 pm
Posts: 42
Location: St Helens, England
Sorry got one of the commands wrong lol, heres an example program. As I said above im not sure if this will work as I'm only a C programmer.

Quote:
#include <stdio.h>

void main()
{
fflush(stdin);
getchar();

return 0;
}

_________________
"Simplicity Is An Art"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: