bracket pairing isn't working
my brackets keep joining into the wrong pairs whenever I finish my function how do I solve this


15 Replies
not sure what you're trying to do
you're writing
public
inside of a methodwhy do you have an access modifier in a method body
that's not valid in the first place
i sterted learning c# today what does that mean
if the issue is confusing output from the IDE when you write invalid C# code, just, don't write invalid C# code
imagine you have an app that can take in an english sentence and sort it into nouns and verbs
and you talk to it in chinese
that's basically what you're doing to the IDE (the application you're writing code in). it's built to pair up those brackets based on valid C#. you're giving it invalid C#. it doesn't know what to do
so i just dont have the brackets?
no, you need the brackets
so how do i make my code valid?
well, don't put the word
public
in a method body, for oneok
by "valid" i mean C# code that compiles
any red squiggly lines or errors that come up when you try to build/run the project are compiler errors
indicating invalid C#
You can not put an access modifier within a scoped block. Public is a access modifier and inside a pair of { } is not valid as has been said.
Unknown User•9h ago
Message Not Public
Sign In & Join Server To View
I was following a tutorial intended for complete beginners