1 2 3 4 5 6 7 8 9 10 11
ifstream fs("id.txt"); string s; getline(fs, s); fs.close(); id = atoi(s.c_str())+1; cout << "id=" << id << endl; s= to_string(id); cout << "zzzzs=" << s << endl; ofstream out("tele2.txt", ios::trunc); out << s; out.close();
1 2
Line 3: error: expected constructor, destructor, or type conversion before '(' token compilation terminated due to -Wfatal-errors.