I am new to C # programming. I am reading a C # book and I am having trouble interpreting the code. In particular, how do the functions {0} and my_double work?
my_double = 3.14;
my_decimal = 3.14;
Console.WriteLine("\nMy Double: {0}", my_double);
I saw this format several times in the book, but it was not explained. I know that he writes this in a console window, but my questions are:
- What does it mean?
- Why it has {0} in braces, it can be replaced with any other number, for example {100}
- How can I use several variables in the last line of code to say print my_decimal as well.
source
share