void DoTurn()
{
cout << Turn << "'s turn!";
int move;
cin >> move
// do some error checking...
if (GameBoard[move])...
}
But NOOooooooo, C# only returns a string with the ReadLine() function and boxing has no effect whatsoever.
[.net] How to get input of just for an integer? (C#)
I'm disliking Console.Read(LINE)() function right now. I'm in the process of making a Tic Tac Toe clone just so I can remember some of the stuff I have learned using C# and it's just being a bitch about every thing. Here's the C/C++ equivilent of what I'd like to do:
string s = Console.ReadLine();try{ int n = Int32.Parse(s);}catch{ // s couldn't be parsed as an integer}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement