Hi,
I use ConsoleWriteline in my console appl but it shows up only very short in a less than a second and disappears
Can anybody help me what to do please?
Thanks
p.s
example
if (i == 15 && r == 16)
{
double Cr = 2048 / counterTotal1;
double Nb = counterTotal1 / 256;
Console.WriteLine("Cr"+Cr.ToString());
Console.WriteLine("Nb" + Nb.ToString());
}

VulpesRank #55 · 29.2K reputationPosted Nov 23, 2014, 6:06 AM EST
Try putting it as the very last line in the Main() method.
VulpesRank #55 · 29.2K reputationPosted Nov 23, 2014, 3:58 AM EST
This will prevent the console window from closing until you've read the output and a key has been pressed.
Stavri8 reputationPosted Nov 23, 2014, 4:13 AM EST
In order to read the console's output,
you can write the expression "Console.ReadKey();"
just like it is shown in the example below.
I hope that the provided solution helps :)
Best regards,
Stavri
//-------------------------------------------------------
using System;
namespace ConsoleApplication_HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
Console.ReadKey();
}
}
}
//-------------------------------------------------------
NelRank #2,060 · 702 reputationPosted Nov 23, 2014, 5:58 AM EST
Hi
thank to both of you but even when I put Console.ReadKey(true) as in example, again the same thing happens The window disappears again
NelRank #2,060 · 702 reputationPosted Nov 23, 2014, 12:23 PM EST