2

Let us say I have a class named "Car". Let us also say that when initializing the object, you give two variables of type int. In the past, when ever I would want to create this object, I would do:

Car myCar(10, 5);

but I recently saw a slitly different way to do this:

Car myCar{10, 5};

What is the difference of using () or using {}?

Metalzero2
  • 531
  • 2
  • 6
  • 17
  • https://stackoverflow.com/questions/7612075/how-to-use-c11-uniform-initialization-syntax – drescherjm Nov 20 '17 at 20:02
  • https://arne-mertz.de/2015/07/new-c-features-uniform-initialization-and-initializer_list/ –  Nov 20 '17 at 20:02

0 Answers0