c++ - 错误 : Cannot add two pointers

标签 c++ pointers

它给出了关于这段代码的标题中的错误:

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

我不明白这是怎么可能的,不涉及任何指针......

编辑:
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;
}

最佳答案

以下应该工作得更好:

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

关于c++ - 错误 : Cannot add two pointers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3108965/

相关文章:

c# - 根据以下标准开发桌面应用程序的语言/平台

c - 指向数组的指针与数组名称有何不同?

c - 尝试使指针为 NULL 时赋值错误中的左值无效

c - 理解 C 中的代码(链表)

c++ - 在C++中向文件写入和加载大数组

c++ - QErrorMessage 不断出现

c++ - 为什么我的 CFRunLoopTimer 没有触发?

c++ - 将单个字符串/字符输入串行监视器

delphi - 如何使用类的地址和变量的偏移量来访问类 var 的值?

c - C程序中使用指针排序