Is that code valid ?
Olivier Galibert
Olivier.Galibert@mines.u-nancy.fr
Mon Nov 10 21:51:00 GMT 1997
I'm not sure whether this should compile or not:
QDate KfindTabDialog::string2Date(QString str)
{
int year,month,day;
sscanf(str,"%2d/%2d/%4d",&day,&month,&year);
if (QDate::isValid(year,month,day))
return(QDate(year,month,day));
else
return(QDate::QDate());
};
I'm actually getting:
kftabdlg.cpp: In method `class QDate KfindTabDialog::string2Date(class QString)':
kftabdlg.cpp:549: parse error before `;'
kftabdlg.cpp:550: confused by earlier errors, bailing out
Line 549 is "return(QDate::QDate());"
Changing that line to "return QDate();" works perfectly though.
OG.
More information about the Gcc
mailing list