c++ - 在 c++ 中,vs2010 的 typeid 名称与 cocoa 的名称不同。为什么?哪一个是对的?

标签 c++ visual-studio-2010 cocoa

int _tmain(int argc, _TCHAR* argv[])
{
    cout<<typeid(.01).name()<<endl;
    cout<<typeid(1).name()<<endl;
    cout<<typeid("ASDF").name()<<endl;
    //printing double, int, const char[5]

    /*
    CCLog("%s",typeid(.1).name());
    CCLog("%s",typeid(1).name());
    CCLog("%s",typeid("SDF").name());
    //but in cocoa: it is d, i, A4_c
    */

    system("pause");
    return 0;
}

返回类型在注释中。

最佳答案

type_info::name 返回的字符串内容是实现定义的。对于不同的编译器,它可能(并且很可能会)不同。所以他们都是对的。

关于c++ - 在 c++ 中,vs2010 的 typeid 名称与 cocoa 的名称不同。为什么?哪一个是对的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11182813/

相关文章:

c++ - 使用函数指针显示函数的返回值

objective-c - 在 Mac OS X 上录制屏幕视频

c++ - HLSL 在代码中获取线程组数和线程数

visual-studio-2010 - 为什么在 Visual Studio 2010 中无法在本地化模式下添加组件?

wpf - 有没有办法使用 Ruby 和 WPF?

c# - 如何抑制 StyleCop 警告 "SA1201: All methods must be placed after all properties."?

objective-c - 收到 NSConcreteNotification,但未定义?

cocoa - NSView边框颜色

c++ - 是否可以使用宏来处理定义的内容?

c++ - 私有(private)成员的继承