Hi Guys
NP51 Carriage return \r in a program
I couldn’t find out any different having Carriage return \r in a program. Anyone knows please explain. I am giving a simple program for your convenient.
Thank you
using System;
public class DisplaySomeMoney
{
public static void
{
double someMoney = 39.45;
int myAge = 25;
Console.WriteLine
("\rThe money is {0}. ${0} is a lot for my age which is {1}."
, someMoney, myAge);
}
}
Posted Oct 9, 2007, 7:22 PM
Thank you, Alan
AlanPosted Oct 9, 2007, 6:47 PM
You're correct, Maha, that writing '\r' to the Windows console has no effect. However, '\n' causes the cursor to move to the first postion of the next line (i.e. a carriage return, line feed combination on a typewriter), as you probably know already.