Wat does this mean. | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Wat does this mean.

the app is trying to tell me how this works but I dont understand what the curly brackets are trying to do? static void Main(string[] args) { int x = 10; double y = 20; Console.WriteLine("x = {0}; y = {1}", x, y); } // Output: x = 10; y = 20

20th Jan 2017, 9:09 PM
Maximus Wallis
Maximus Wallis - avatar
2 ответов
+ 2
Console.WriteLine ("{0}, {1}", x, y); Here, the {0} and {1} are placeholders, allowing you to put different data types in a string, similar to cout << "x = "<<x << " and y = " << y; in cpp
20th Jan 2017, 9:15 PM
Aaron
Aaron - avatar
+ 1
oh.. I see. thank you very much!
20th Jan 2017, 9:20 PM
Maximus Wallis
Maximus Wallis - avatar