Confusion in a really a basic question:
I have seen in many books, they use use Console.WriteLine as:
int i = 12;
Console.WriteLine("MyVariable value is {0}", i);
Instead of
int i = 12;
Console.WriteLine("MyVariable value is" + i);
Is there any difference between them?
in your example, practically not. However, the first case can easily be extended to do
which could be a little cumbersom with the second approach.