Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cmd jsyt closes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Dec 01, 2007 9:41 am    Post subject: Cmd jsyt closes Reply with quote

Well im using C# express edition 2008

and when i run my console application after i type the 2nd integer the cmd closes before is shows the answer... (im adding to numbers)



Quote:
Code:


// Fig. 3.18: Addition.cs
  // Displaying the sum of two numbers input from the keyboard.
  using System;
 
  public class Addition
  {
     // Main method begins execution of C# application
     public static void Main( string[] args )
     {
       int number1; // declare first number to add   
       int number2; // declare second number to add 
       int sum; // declare sum of number1 and number2

       Console.Write( "Enter first integer: " ); // prompt user
       // read first number from user
       number1 = Convert.ToInt32( Console.ReadLine() );

       Console.Write( "Enter second integer: " ); // prompt user
       // read second number from user
       number2 = Convert.ToInt32( Console.ReadLine() );

       sum = number1 + number2; // add numbers

       Console.WriteLine( "Sum is {0}", sum ); // display sum
    } // end method Main
 } // end class Addition

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Dec 01, 2007 9:43 am    Post subject: Reply with quote

That's normal.
_________________
Back to top
View user's profile Send private message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Dec 01, 2007 9:44 am    Post subject: Reply with quote

ok... How do i make it NOT close?
_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Dec 01, 2007 9:47 am    Post subject: Reply with quote

goldengold wrote:
ok... How do i make it NOT close?


run it from cmd.

cd <file location>
<file name>
Back to top
View user's profile Send private message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Dec 01, 2007 9:52 am    Post subject: Reply with quote

so thats the only way?

isint there something like

Return (0) or something that doesent close it?

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Dec 01, 2007 10:10 am    Post subject: Reply with quote

Code:
Console.Readline();


Add the readline after the last input in your code to pause it. (Suggested via a ton of links by searching google. I'm not a C# programmer, but figured I'd say it since no one else has.)

Also, someone wrote their own console class for the reason of not having the ability to use something like getch() as in C/C++ which can be found here:
http://www.codeproject.com/cs/library/csconsolelibrary.asp

You can also import getch as well.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Dec 01, 2007 10:12 am    Post subject: Reply with quote

I found a way to see the answer...


I just step into it Razz

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites