Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- welcomebits.cpp:30:74: error: could not convert ‘{tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance}’ from ‘<brace-enclosed initializer list>’ to ‘User’
- User u={tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance};
- ^
- struct User{
- std::string fullname="";
- std::string user_name="";
- float PIN=0.;
- float balance=0.;
- };
- void create_user_data(std::vector<User>& 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>>tmp_PIN>>comma;
- ss>>tmp_balance;
- User u={tmp_fullname, tmp_user_name, tmp_PIN, tmp_balance};
- uv.push_back(u);
- }
- }
Add Comment
Please, Sign In to add comment