patilakash
28th April 2016, 13:43
The following is my piece of code:
QString fileName = appData + DIR+ "AISTABLE";
fileName = fileName + d_local.toString("_yyyy-MM-dd") + t_local.toString("_HH-mm-ss") + ".csv";
f_out = fopen(fileName.toAscii().data(), "wb+");
if (f_out == NULL) {
return;
}
QString headerString = "d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11\r\n";
for(int row = 0;row <ui->tableWidget->rowCount()-1; row++)
{
for(int column = 0;column< ui->tableWidget->columnCount()-1 ;column++)
{
headerString += ui->tableWidget->item(row,column)->text() +",";
}
headerString += "\r\n";
}
fprintf(f_out,"%s",headerString.toAscii().data());
fflush(f_out);
fclose(f_out);
I have created the Qtablewidget using Qt designer with rows = 300 and column = 12.
When I execute the above program, I get the following error:
Unhandled exception at 0x5463d72c in File.exe: 0xC0000005: Access violation reading location 0x00000000.
What is the problem for not getting output?
QString fileName = appData + DIR+ "AISTABLE";
fileName = fileName + d_local.toString("_yyyy-MM-dd") + t_local.toString("_HH-mm-ss") + ".csv";
f_out = fopen(fileName.toAscii().data(), "wb+");
if (f_out == NULL) {
return;
}
QString headerString = "d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11\r\n";
for(int row = 0;row <ui->tableWidget->rowCount()-1; row++)
{
for(int column = 0;column< ui->tableWidget->columnCount()-1 ;column++)
{
headerString += ui->tableWidget->item(row,column)->text() +",";
}
headerString += "\r\n";
}
fprintf(f_out,"%s",headerString.toAscii().data());
fflush(f_out);
fclose(f_out);
I have created the Qtablewidget using Qt designer with rows = 300 and column = 12.
When I execute the above program, I get the following error:
Unhandled exception at 0x5463d72c in File.exe: 0xC0000005: Access violation reading location 0x00000000.
What is the problem for not getting output?