mardi 28 août 2018

what is the difference between i{1} and i(1) in c++

I noted that I can create on object in two ways:

struct A
{ 
      int a;
      A(int i)
      {
          a=i;
       }
}

A i(1);
A i{1};

What is the difference between them and which one to use?

Aucun commentaire:

Enregistrer un commentaire