EDN Admin
Well-known member
I have been into C++ for a few months and got up to learning functions, pointers, references, and a little OOP. I wanted to experiment with C#, for many personal reasons. It seems to attract me more..
With C++ all you have to do is..
cout << "Enter a num";
cin >> num;
Now, in C#
I dont know how to get a user input for a number.The Console.ReadLine() only does strings I believe. And I remember using something else..but when I entered 4 it output 52, input 5 i get 53. Thats probably the ASCII codes? How can I just get it to output the number? An example of a "guess my number" program would be much appreciated <img height=19 alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" width=19>
Marky03
View the full article
With C++ all you have to do is..
cout << "Enter a num";
cin >> num;
Now, in C#
I dont know how to get a user input for a number.The Console.ReadLine() only does strings I believe. And I remember using something else..but when I entered 4 it output 52, input 5 i get 53. Thats probably the ASCII codes? How can I just get it to output the number? An example of a "guess my number" program would be much appreciated <img height=19 alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" width=19>
Marky03
View the full article