I don't really know what's the issue here? I'm am A RLLY NEW C# learner so maybe you guys can help?
5 Replies
Okay a few issues:
1.
Main
has to have the signature static void Main()
or static void Main(string[] args)
.
2. Console
is a static class, which just means that you can't pass it into a method like Main
.
3. You're calling Main(argconsole, console)
at the end of the Main
method, which would cause the method to repeat infinitely.
4. Replace Convert.ToInt32
with int.Parse
, Convert.ToInt32
shouldn't be used as it has several oddities about it.
Other than that, the console looks fine.$mains
The possible signatures for
Main
are public
is not required (can be any accessibility).
Top-level statements are compiled into a Main
method and will use an appropriate signature depending on whether args
is referenced, the await
operator is used and/or an explicit return
statement is used.
https://docs.microsoft.com/en-US/dotnet/csharp/fundamentals/program-structure/main-command-lineMain() and command-line arguments
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
(although you don't have to worry about the
async Task
ones)Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.