Exception with int to string convert in WriteLine

1.6k Views Asked by At

Picture

Exception on english: "Argument 1: cant convert "int" into "string".

But in my parametrs and arguments I used only "int" type.

How can I typed my parameters (X and Y) used WriteLine method?

1

There are 1 best solutions below

0
On BEST ANSWER

Add an explicit .ToString, e.g.

Console.WriteLine(3.ToString());

Or use string.format:

Console.WriteLine(String.Format("{0}, {1}", a, b));

(Amongst others).