Question about C#

Hello, Ben!
I met some difficulties when trying to reproduce your code in lecture 13 “Your first function” It underlines red and doesn’t work.I’ve made some screens of it.




Probably, you can give me a piece of advice, what to do.
Yesterday i met a problem with previous section - I needed manually find script in Visual Studio 2017 and add it.

I think you probably meant to open a new topic. Looking over your code, in the first screenshot you define a void ShowMainMenu() method, but don’t add the correct { } curly braces to open and close it, but rather placed a semicolon.

In the second screenshot, after you called ShowMainMenu(); on line 9 you close the Start() method with a } curly brace. The Terminal lines following are now placed outside of a method. You then have another } curly brace. At this point unwantingly closing the class.

Thank you, Stef!!! Now it works!! :grinning:Hurrah! !
(Sorry for this mess in a wrong topic, I’m absolute beginner).

Hi Volha,

I’m glad Stef was able to help you. :slight_smile:


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms