0

[SOLVED] Why does C# no accept user input in Playground?

So lately I've noticed that C# does not show a pop-up window for input, when using Console.ReadLine (). Anyone know why that is?

7th Feb 2020, 6:45 PM
Mike Mortensen
Mike Mortensen - avatar
23 Respuestas
+ 5
~ swim ~ don't work: string input = Console.ReadLine (); works: string input = Console.ReadLine();
7th Feb 2020, 6:56 PM
Denise Roßberg
Denise Roßberg - avatar
+ 5
Mike Mortensen It's not working because there is space between ReadLine and parenthesis (). It should be like Console.ReadLine()
7th Feb 2020, 6:56 PM
A͢J
A͢J - avatar
+ 4
.Mike Mortensen I don't know why exception not came but that was the problem.
7th Feb 2020, 7:00 PM
A͢J
A͢J - avatar
+ 4
Mike Mortensen Denise Roßberg It maybe Sololearn issue because when I am printing value using this below syntax it's working fine. Console.WriteLine (input);
7th Feb 2020, 7:05 PM
A͢J
A͢J - avatar
+ 2
Denise Roßberg, 🅰🅹 - Sʀ. Sᴏғᴛᴡᴀʀᴇ Eɴɢɪɴᴇᴇʀ: In the couch challenged the input goes through with bo problems. It's only that the box not popping up if there's a space inbetween 🤔
7th Feb 2020, 7:02 PM
Mike Mortensen
Mike Mortensen - avatar
+ 2
~ swim ~ Thanks for clarification.
7th Feb 2020, 7:05 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Well, there's no code, as it's not really the code that's wrong. But let me write some code and get back to you :-)
7th Feb 2020, 6:49 PM
Mike Mortensen
Mike Mortensen - avatar
+ 1
Mike Mortensen string input = Console.ReadLine(); works remove the space between ReadLine and ()
7th Feb 2020, 6:54 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Have a look at the comment I posted right before yours, ~ swim ~ :-) The code is almost identical. 🤔 So Maybe it's my app that's bugged. I've coded in C# for 8 years. So I'm pretty sure I'm not coding it wrong 😅🤷‍♀️
7th Feb 2020, 6:55 PM
Mike Mortensen
Mike Mortensen - avatar
+ 1
Thanks Denise Roßberg ! I wonder why that is? 😅
7th Feb 2020, 6:57 PM
Mike Mortensen
Mike Mortensen - avatar
+ 1
Mike Mortensen me too. ~ swim ~ Do you know if this is a real syntax error or if it is a sololearn issue?
7th Feb 2020, 6:58 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Mike Mortensen In java it is possible: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scan = new Scanner (System.in); int n = scan.nextInt (); System.out.println (n); } } Maybe only sololearn knows why it is not possible in C# ;)
7th Feb 2020, 7:02 PM
Denise Roßberg
Denise Roßberg - avatar
0
Please share a code so that we can examine it.
7th Feb 2020, 6:47 PM
Denise Roßberg
Denise Roßberg - avatar
7th Feb 2020, 6:52 PM
Mike Mortensen
Mike Mortensen - avatar
0
That is odd to me, as it's not really a syntax error, 🅰🅹 - Sʀ. Sᴏғᴛᴡᴀʀᴇ Eɴɢɪɴᴇᴇʀ 🤔
7th Feb 2020, 6:57 PM
Mike Mortensen
Mike Mortensen - avatar
0
It's a Sololearn issue, Denise Roßberg . I'm coding in Visual Studio every day. It's a formatting habit of mine and syntax errors would be flagged bybthe compiler:-)
7th Feb 2020, 7:00 PM
Mike Mortensen
Mike Mortensen - avatar
0
How many ways to take input in java
9th Feb 2020, 11:18 AM
Maneesh Pandey
Maneesh Pandey - avatar
0
Вы можете преобразовать строку в целое число, используя Convert.Функция ToInt32() int intTemp =...
9th Feb 2020, 2:27 PM
Никита Гуляев
Никита Гуляев - avatar
9th Feb 2020, 3:36 PM
Mike Mortensen
Mike Mortensen - avatar
0
Sorry.. I think you are Russian
9th Feb 2020, 3:49 PM
Никита Гуляев
Никита Гуляев - avatar