I have a small error that is quite confusing
I am a little new to programming and especially into C# but this part of this code I am trying to understand and edit a little is a little confusing because there is an error and I am, not super sure on how to fix it. I have posted a picture of the code and the error. the photo of the protentional fix doesn't work so I am just posting this here so i am making it clear that that doesn't work
4 Replies
you can't declare a method just anywhere
in this case, it seems you are trying to declare one inside an if-statement
yes, that makes sense thanks
well um if I get rid of it I need it to have another piece of code is not declared or whateverso there is an error
I'd suggest just declaring the method somewhere else
like, on the class you are currently in?
then call your method inside the if-statement
instead of declaring it there
declaring a method does not call it