New course! Every coder should learn Generative AI!
Try a free lesson0
Is there any way to get some input DURING the execution of my program and not at the beginning (c#)
5 Answers
0
What type of application are you creating?
0
just a console game in c#
0
Well, you can put input inside infinite loop.
For example:
string input;
while(true){
input = Console.ReadLine();
if(input == "exit"){
Console.WriteLine("Until next time!");
break;
} else if(input == "stats"){
//Print or call some methods here and so on.
}
}
Anyway, If you want something more complex and, for example, read user input WHILE something goes on in the background, lets say, some output or calculations, you should consider using threads.
0
Please could you add your code so we can try and provide a solution.
0
i mean that i want to do that in code playground, in VS i know how to do it, but code playground asks to enter all values before running the code