C++?ж??????????????
???????????? ???????[ 2014/4/8 10:26:44 ] ????????C++ ???
????????
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int _tmain(int argc?? _TCHAR* argv[])
{
//д?????
ofstream ofs; //??д????????
ofs.open("d:\com.txt"??ios::trunc); //trunc??????????????????????????????????????????
int i;
char a = 'a';
for(i = 1; i != 27; ++i)
{
if(i < 10)
{
ofs << "0" << i << " " << a << "
";
a ++;
}
else
{
ofs << i << " " << a << "
";
a ++;
}
}
ofs.close();
//??????????????
char buffer[256];
ifstream ifs; //???????????
ifs.open("d:\com.txt"??ios::in);//in--?????????????
cout << "d:\com.txt" << "?е????????£?" << endl;
while(!ifs.eof()) //?ж?????stream???β
{
ifs.getline(buffer?? 256?? '
'); //?????256???????????н???
cout << buffer << endl;
}
ifs.close();
}
?????????
ifstream ifile("1.txt");
if(! ifile) {
cerr<<"error."<<endl;
return -1;
}
string lineword;
while(getline(ifile??lineword??'
')) {
cout<<lineword<<endl;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11