C
C#10mo ago
Gijs

✅ C# webforms counting problem

Hey I'm new to c# I have been working with c# for 3 days now but I stummbeld on a problem I can't get fixed
public int counter = 3;

MessageBox.Show("You have" + counter - 1 + "Tries left");
public int counter = 3;

MessageBox.Show("You have" + counter - 1 + "Tries left");
once I do this I get the error: Operator '-' cannot be applied to operands of type 'string' and 'int'. And I have no idea how to fix it. It's probarlly something really simple but I just can't seem to get it
2 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Gijs
Gijs10mo ago
aha thanks