Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2003, 03:22 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default easy question

I have a simple code as following
// :c03:Assignment.cs

class Number
{
    public int i;
}

public class Assignment
{
    public static void Main()
    {
        Number n1 = new Number();
        Number n2 = new Number();

        n1.i = 9;
        n2.i = 47;

        System.Console.WriteLine("1: n1.i: " +n1.i + ", n2.i: " + n2.i);
        n1.i = n2.i;
        System.Console.WriteLine("2: n1.i: " +n1.i + ", n2.i: " + n2.i);
        n1.i = 27;
        System.Console.WriteLine("3: n1.i: " +n1.i + ", n2.i: " + n2.i);

    }
}
when I compiled and ran the exe file I just saw a flash and that was it. How can I make the dos windows to stay that I can see the result? Please help this beginner!
 
Old August 5th, 2003, 03:33 PM
NoXuS
Guest
 
Posts: n/a
Default

From the Debug menu select Start without Debugging (CTRL+F5) instead of Start (F5)
 
Old August 5th, 2003, 04:22 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I compiled this by command line not from vs.net
c:\csc Assignment.cs
Then I did double click on Assignment.exe to view, but it was just flashing and disappeared..
 
Old August 6th, 2003, 01:57 AM
Registered User
 
Join Date: Jun 2003
Location: Hamburg, Hamburg, Germany.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is not a C# or DevStudio issue. This will happen with any executable, which doesn't require user input.

Just open a command line first and execute the program from the command line.

Hope this helps,
Boris

GFT Solutions GmbH
www.hyparchiv.com
 
Old August 6th, 2003, 01:17 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh I got it. I just put the System.Console.ReadLine() right after System.Console.WriteLine(). Thanks for all inputs.




Similar Threads
Thread Thread Starter Forum Replies Last Post
hopefully an easy question davehodges Access 1 November 7th, 2007 06:36 AM
Quick And easy question redchord C# 1 January 30th, 2007 09:45 AM
Easy Question hexOffender Beginning PHP 2 July 12th, 2006 05:03 AM
Easy Question yikomaka Visual C++ 0 June 13th, 2005 08:50 PM
Easy Question - I think gmoney060 Classic ASP Basics 3 November 2nd, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.