This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Is that code valid ?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]