const A &x = A(1); // where A is a defined class | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

const A &x = A(1); // where A is a defined class

What does the above line mean?

9th Jul 2017, 3:53 AM
Kushagra Agarwal
Kushagra Agarwal - avatar
1 Answer
+ 1
It creates a constant instance of A class, which is initialized with 1 (passing 1 to the constructor).
10th Jul 2017, 2:53 AM
Ali Rashidi
Ali Rashidi - avatar