468x60 Ads

free counters

contoh program splitting C++

#include
#include
#include
#include

typedef struct { int nilai;
}rekarray;

rekarray rekA, rekB, rekC;

int main()
{
clrscr();
ifstream arrayC("array pusat.txt",ios::app);
ofstream arrayA("array B.txt",ios::app);
ofstream arrayB("array C.txt",ios::app);

if(arrayC.eof())
{
cout<<"file kosong";
}
else
{
do
{
if(rekA.nilai % 2 == 0)
{
arrayA.write((char*)&rekC,sizeof(rekC));
}
else
{
arrayB.write((char*)&rekC,sizeof(rekC));
}
arrayC.read((char*)&rekC,sizeof(rekC));
}while(arrayA.eof());
}

system("pause");
arrayA.close();
arrayB.close();
arrayC.close();
}

0 komentar:

Posting Komentar

 
Impossible is Nothing © 2011 Theme made with the special support of Maiahost for their cheap WordPress hosting services and free support.