title: Cannot convert to struct from brace-enclosed initializer list
body: <p>I looked around and couldn't find a question that answered my problem clearly so I am posting this one. 
  I am getting this error when I try to compile my code:</p>
  
  <pre><code>welcomebits.cpp:30:74: error: could not convert ‘{tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance}’ from ‘&lt;brace-enclosed initializer list&gt;’ to ‘User’
               User u={tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance};
                                                                        ^
  </code></pre>
  
  <p>Why does this happen? I am new to c++ and I am just getting used to structs, classes and objects are still beyond me. I recently learned pass by reference and pointers so those I understand in the basic sense.</p>
  
  <p>Here is my struct definition and the function where the error occurs:</p>
  
  <pre><code>struct User{
      std::string fullname="";
      std::string user_name="";
      float PIN=0.;
      float balance=0.;
  };
  
  
  void create_user_data(std::vector&lt;User&gt;&amp; uv){
  
      std::ifstream reader;
      std::string holder="";
      char comma=',';
      std::string tmp_fullname="";
      std::string tmp_user_name="";
      float tmp_PIN=0.;
      float tmp_balance=0.;
  
      reader.open("database.csv");
  
      while(std::getline(reader, holder)){
              std::istringstream ss(holder);
              std::getline(ss, tmp_fullname, ',');
              std::getline(ss, tmp_user_name, ',');
              ss&gt;&gt;tmp_PIN&gt;&gt;comma;
              ss&gt;&gt;tmp_balance;
  
              User u={tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance};
              uv.push_back(u);
      }
  }
  </code></pre>
  
  <p>Thanks for your time and help everyone.</p>