Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Cannot add two pointers

Tags:

c++

pointers

It gives the error in the title about this piece of code:

string DDateTime::date2OracleDate(DATE Date)
{
    string s;
    s="TO_DATE('" + DateFormat("%d/%m/%Y",Date) + "','dd/MM/YYYY')";
    return s;
}

I don't understand how that is possible, no pointers involved....

EDIT:

string DDateTime::DateFormat(string sFormat,DATE Date)
{
    struct tm tmTemp;
    RipOf_AfxTmFromOleDate(Date, tmTemp);
    RipOf_AfxTmConvertToStandardFormat(tmTemp);
    char sFormatted[MAX_TIME_BUFFER_SIZE];
    strftime(sFormatted, MAX_TIME_BUFFER_SIZE, sFormat.c_str(), &tmTemp);
    return sFormatted;
}
like image 607
Tony The Lion Avatar asked Dec 09 '22 15:12

Tony The Lion


1 Answers

The following should work better:

string DDateTime::date2OracleDate(DATE Date)
{
    string s = "TO_DATE('";
    s += DateFormat("%d/%m/%Y",Date);
    s += "','dd/MM/YYYY')";
    return s;
}
like image 167
Amardeep AC9MF Avatar answered Dec 30 '22 09:12

Amardeep AC9MF