char *buf;
__int64 curcount=0;
static int const rec_len = 21;
static int const max_count = 1024*1024;
static int const buf_size = rec_len * max_count;
buf=new char[buf_size];
// std::auto_ptr<char> buf(new char[buf_size]);
char *hao[35];
int i1,i2,i3,i4,i5,i6,i7;
hao[0]="01",hao[1]="02",hao[2]="03",hao[3]="04",hao[4]="05",hao[5]="06",
hao[6]="07",hao[7]="08",hao[8]="09",hao[9]="10",hao[10]="11",hao[11]="12",
hao[12]="13",hao[13]="14",hao[14]="15",hao[15]="16",hao[16]="17",hao[17]="18",
hao[18]="19",hao[19]="20",hao[20]="21",hao[21]="22",hao[22]="23",hao[23]="24",
hao[24]="25",hao[25]="26",hao[26]="27",hao[27]="28",hao[28]="29",hao[29]="30",
hao[30]="31",hao[31]="32",hao[32]="33",hao[33]="34",hao[34]="35";
filebuf buffer;
ostream output(&buffer);
buffer.open("xxxx.txt",ios:
ut|ios::trunc);
for(i1=1;i1<=29;i1++)
for(i2=i1+1;i2<=30;i2++)
for(i3=i2+1;i3<=31;i3++)
for(i4=i3+1;i4<=32;i4++)
for(i5=i4+1;i5<=33;i5++)
for(i6=i5+1;i6<=34;i6++)
for(i7=i6+1;i7<=35;i7++)
{
++curcount;
buf[curbyte-1]='01';
//改成:buf[curbyte-1]=hao[i1-1];就编译不过去.
curbyte++;
buf[curbyte-1]='02';
curbyte++;
buf[curbyte-1]='03';
curbyte++;
buf[curbyte-1]='04';
curbyte++;
buf[curbyte-1]='05';
curbyte++;
buf[curbyte-1]='06';
curbyte++;
buf[curbyte-1]='07';
curbyte++;
buf[curbyte-1]='/n';
if(max_count==curcount)
{
output.write(buf,curcount*rec_len);
curcount=0;
delete buf;
buf=new char[buf_size];
// std::auto_ptr<char> buf(new char[buf_size]);
}
}
大概用了5'多 代码还有很多问题,谁能帮忙看一下,先谢了!!!