This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is that code valid ?
- To: egcs at cygnus dot com
- Subject: Is that code valid ?
- From: Olivier Galibert <Olivier dot Galibert at mines dot u-nancy dot fr>
- Date: Tue, 11 Nov 1997 06:51:32 +0100
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.