RT下面的程序老是通不过编译,转换失败
static const uint16 szNoMem[8][21] = 

L"Memory low!",
L"Restart the comp",
L"and try again.",
L"If you see this",
L"info again, please",
L"contact us",
L"***************"
};

解决方案 »

  1.   

    L指示后边的字符串是宽字符的,即每个字符占两个字节。
    不知道你的平台是什么,我的Vc6里没有uint16 类型。应该使用 unsigned short 类型。
      

  2.   

    L"Memory low!"
    通常L引号里面是UNICODE编码
      

  3.   

    这么快就有人了,谢谢。
    是BREW平台,C++
    忘了写:
    typedef  unsigned short     uint16;错误信息是:Error 39 error C2440: 'initializing' : cannot convert from 'const wchar_t [17]' to 'const uint16
      

  4.   

    typedef  unsigned short     uint16;         L"Memory low!",
    L"Restart the comp",
    L"and try again.",
    L"If you see this",
    L"info again, please",
    L"contact us",
    L"***************"
    是不是不匹配,我犯了一下windows程序设计,也没有法现,它们之间可以进行转化。
      

  5.   

    改成试试
    static const wchar_t* szNoMem[21] = 

    L"Memory low!",
    L"Restart the comp",
    L"and try again.",
    L"If you see this",
    L"info again, please",
    L"contact us",
    L"***************"
    };
      

  6.   

    我觉得按着C++语法,是不能行的通的:typedef  unsigned short     uint16;  为无符号短整形,而  L"Memory low!",
            L"Restart the comp",
            L"and try again.",
            L"If you see this",
            L"info again, please",
            L"contact us",
            L"***************",为unicode的宽字符,它们之间要是能够转化用编译器会编译过去的,看起来是不能转化。