Hi,
there is a 2D array 500*100,000 like this:
double (*data)[100000];
data = new double[500][100000];
for(int i=0; i<500; i++)
{
for(int j=0; j<100000; j++)
{
if(j==0)
{
data[i][j]=0xdd00bb00;//i want this to be my header
continue;
}
data[i][j] = (i+1)*(j+1);
}
}
// now data was initialized
double (*data)[100000];
data = new double[500][100000];
for(int i=0; i<500; i++)
{
for(int j=0; j<100000; j++)
{
if(j==0)
{
data[i][j]=0xdd00bb00;//i want this to be my header
continue;
}
data[i][j] = (i+1)*(j+1);
}
}
// now data was initialized
To copy to clipboard, switch view to plain text mode
I wrote this code:
{
{
qDebug()<<"can not open to write";
return;
}
//now I want to write all of "data" in binary mode
myfile.flush();
myfile.close();
}
void write(QString filename)
{
QFile myfile(filename);
if(!myfile.open(QIODevice::WriteOnly))
{
qDebug()<<"can not open to write";
return;
}
QDataStream out(&myfile);
//now I want to write all of "data" in binary mode
myfile.flush();
myfile.close();
}
To copy to clipboard, switch view to plain text mode
thanks for any help
Bookmarks