I was reading the book Fundamentals of Computer Programming with C#
string str = Console.ReadLine();
int Value;
bool parseSuccess = Int32.TryParse(str, out Value);
Console.WriteLine(parseSuccess ? "The square of the number is " + (Value * Value) + " . " : "Invalid number!" );
So my question is that in the third line bool parseSuccess = Int32.TryParse(str, out Value);
the Int32.TryParse()
won't it return an int
value? How can that be bool
? And what exactly does the keyword out
mean?