✅ Method creation
I can't understand what he doesn't like if I wrote it right.
Please help.
8 Replies
PrintPerson
is underlined in red. Have a look at the error there 😉But I did.
The error's slightly cryptic. The problem is the
;
at the end of the PrintPerson
lineOh lol, thank you so much.
So you've declared a method without a body (the compiler sees
void PrintPerson(string name, int age);
as the method definition). The compiler complains that the method has no body, then treats the block afterwards as a bit of normal code, and complains about the unknown name
variableWhat you have here is akin to
Use the /close command to mark a forum thread as answered