C
C#10h ago
slimyfrog

bracket pairing isn't working

my brackets keep joining into the wrong pairs whenever I finish my function how do I solve this
No description
No description
15 Replies
mg
mg10h ago
not sure what you're trying to do
ero
ero10h ago
you're writing public inside of a method
mg
mg10h ago
why do you have an access modifier in a method body
ero
ero10h ago
that's not valid in the first place
slimyfrog
slimyfrogOP10h ago
i sterted learning c# today what does that mean
mg
mg10h ago
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
slimyfrog
slimyfrogOP10h ago
so i just dont have the brackets?
mg
mg10h ago
no, you need the brackets
slimyfrog
slimyfrogOP10h ago
so how do i make my code valid?
mg
mg10h ago
well, don't put the word public in a method body, for one
slimyfrog
slimyfrogOP10h ago
ok
mg
mg10h ago
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#
glhays
glhays10h ago
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
Unknown User9h ago
Message Not Public
Sign In & Join Server To View
slimyfrog
slimyfrogOP8h ago
I was following a tutorial intended for complete beginners

Did you find this page helpful?