please use [CODE] tag
void DatumForm::readfile()
{
int count = 0;
bool ok;
resulttemp = datumnolineEdit->text();
int lineNo = resulttemp.toInt(&ok, 10);
QFile file( "datum.txt" );
if ( file.open( IO_ReadWrite ) ) {
while ( !stream.atEnd() ) {
count += 1;
line = stream.readLine( );
if(lineNo == count)
printf( "%3d: %s\n", count, line.latin1() );
}
file.close();
}
void DatumForm::readfile()
{
QString resulttemp;
int count = 0;
bool ok;
resulttemp = datumnolineEdit->text();
int lineNo = resulttemp.toInt(&ok, 10);
QFile file( "datum.txt" );
if ( file.open( IO_ReadWrite ) ) {
QTextStream stream( &file );
while ( !stream.atEnd() ) {
count += 1;
line = stream.readLine( );
if(lineNo == count)
printf( "%3d: %s\n", count, line.latin1() );
}
file.close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks