| |
 | Posted by erdem in reply to sefaturk77 | Permalink Reply |
|
erdem 
Posted in reply to sefaturk77
| Şu şekilde okuyup yazabilirsin.
#include <fstream>
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
std::ifstream kutuk("deneme.txt");
std::string satir;
while (getline(kutuk, satir))
{
string isim, ayrac;
int no, not1, not2;
string not3;
std::istringstream satirOku(satir);
satirOku >> no;
getline(satirOku, ayrac, '#');
satirOku >> isim;
getline(satirOku, ayrac, '#');
satirOku >> not1;
getline(satirOku, ayrac, '#');
satirOku >> not2;
getline(satirOku, not3, '\n');
std::cout << no << isim << not1 << '\n';
}
}
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]
|