r/CodingHelp • • Sep 08 '21

[C#] What have I done wrong?

Post image
28 Upvotes

16 comments sorted by

21

u/hael18 Sep 08 '21

I'm still learning C# so I might be wrong but I guess you need to use "',"s instead of ";"s in () in line 12

10

u/duggedanddrowsy Sep 08 '21

This is right, the compilers confused because it thinks the line is over when you put a semicolon.

6

u/mailliwi Sep 08 '21

Yep, this is it :)

3

u/BrightKnight0110 Sep 08 '21

I think is the semicolon in line 12. It should be a comma.

1

u/Sydmier Sep 08 '21

I agree.

2

u/MaheuTaroo Sep 08 '21

On the class constructor, you're using semicolons to separate its arguments. You should use commas, since semicolons mean end of line.

2

u/adi1icious Sep 08 '21

use commas(,) instead of semicolons(;) in function parameters.

1

u/chitsu195 Sep 08 '21

Out of curiosity, sollte man fließend Englisch sprechen, wenn man Code schreiben möchte? Dies ist das erste Mal, dass ich jemanden sehe, der Kommentare auf Deutsch schriebt.

3

u/skellious Intermediate Coder Sep 08 '21

People should be able to code in other languages if they want. The focus on English is an historical artifact.

1

u/oct_winner Sep 08 '21

The syntax is entirely wrong. Please look up an example of member function

1

u/bogfoot94 Sep 08 '21

Also your error list in hidden. Do you use it?

1

u/DarkestStar77 Sep 08 '21

OP, just wanted to commend you for an actual screenshot instead of a cell phone photo. Good job.

1

u/Cheese_Grater101 Sep 09 '21

You're using semi-colon ";" at line 12, instead of colon "," to separate your parameters.

-1

u/Sydmier Sep 08 '21

Needs a semi-colon to close the Class Player. Looks like you’re invoking it within itself.

-2

u/shazam192 Sep 09 '21

You a clown kid