title: Initializing class instance with curly braces
body: <p>I am aware struct and class in C++ are very similar and struct members are by default having public access, while class members having private access and so on..etc.</p>
  
  <p>However, since struct instances can be initialized like this:</p>
  
  <pre><code>struct MyStruct{
      int a;
      int b;
      int c;
  };
  
  MyStruct s1 = {1, 2, 3};  //a=1, b=2, c=3
  MyStruct s2 = {};  //a=0, b=0, c=0
  </code></pre>
  
  <p>Is it safe to do the same for classes in C++? For example:</p>
  
  <pre><code>class MyClass{
      int a;
      int b;
      int c;
  };
  
  MyClass c1 = {1, 2, 3};  //a=1, b=2, c=3
  MyClass c2 = {};  //a=0, b=0, c=0
  </code></pre>
  
  <p><strong>Question</strong>: I am aware we can use constructor(s), is there any pitfalls I should be aware of if I initialize class instance like struct instances? Is this a safe operation if I use this approach to initialize the data members to its default values (e.g. 0 for int and null for pointers)?</p>