Reply To: Cannot implicitly convert type int to string? why?

Home Forums C# Programming Cannot implicitly convert type int to string? why? Reply To: Cannot implicitly convert type int to string? why?

#3405

msaqib
Participant

HelloYou are trying to use string type variable in your switch statement which is expecting an int type variable. Here is how you are doing

Now the problem is you can not use string type variable in switch statement. You could use it like

Or you could have use int type variable like

Share
Tweet
Share
Pin
+1