Console does not record input

Updated on May 31, 2017 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
6 on May 8, 2017

I cannot supply input in Xamarin Studio. I just installed it ( newest version as of May 8, 2017 ). Program stops and is waiting for the input however the console is not recording any keys that are pressed. Any ideas why? Help is appreciated!

Edit:
Code is from C# tutorial #4. Here is the code:

using System;
namespace FirstConsoleProject
{
 class MainClass
 {
 // This is a method called Main()
 // This is the first method called when program is run
 public static void Main(string[] args)
 {
 Console.WriteLine("How old are you?");
 int age = Convert.ToInt32(Console.ReadLine());
 if (age < 18)
 {
 Console.WriteLine("Less than 18");
 }
 else if (age == 18)
 {
 Console.WriteLine("Wow, 18!");
 }
 else 
 {
 Console.WriteLine("More than 18");
 }
 Console.WriteLine("Done.");
 }
 }
}

  • Liked by
Reply
5 on May 8, 2017

If you post your code it will help a bunch, somewhat difficult to find a solution one knows very little about c:

on May 8, 2017

I just updated the question by adding the code.

Wise
on May 31, 2017

I believe this would be a better fix:

string input = Console.ReadLine();
int age = Convert.ToInt32(input);

Wise
on May 31, 2017

That should have the same result. It’s weird that it does that.

Wise
on May 31, 2017

Maybe this: https://forums.xamarin.com/discussion/5438/can-put-nothing-on-input

Wise
on May 31, 2017

Just use Google, it has a lot of answers.

Show more replies
  • Liked by
Reply
Cancel