Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> andmed;
- void prindiNimekiri()
- {
- cout<<"Sisesta faili nimi: ";
- string failinimi;
- cin>>failinimi;
- ifstream sisend(failinimi.c_str());
- if(not sisend.is_open())
- {
- cout<<"Faili ei saa avada!\n";
- }
- while(sisend.good())
- {
- string rida;
- getline(sisend,rida);
- int pos = rida.find_last_of("\t");
- string nimi = rida.substr(0, pos);
- string palk = rida.substr(pos+1);
- int i = atoi(palk.c_str());
- cout<<nimi<<"\t"<<i<<endl;
- andmed.push_back(rida);
- }
- sisend.close();
- }
Add Comment
Please, Sign In to add comment