注册 登录
编程论坛 C++教室

请教高手一个关于__int64型数据输出的问题

sunlong 发布于 2008-07-12 12:46, 819 次点击
#include <iostream>
using namespace std;
typedef unsigned __int64 ULONGLONG;
int main()
{
    ULONGLONG s=1000000000000
    cout<<s<<endl;
    return 0;
}
在vc6下编译后出现error:'operator <<' is ambiguous
请问是vc6不支持__int64?还是其他原因,请高手解决下。
2 回复
#2
linren2008-07-12 13:36
#include <iostream>
using namespace std;

typedef unsigned __int64 ULONGLONG;
int main()
{
    ULONGLONG s=1000000000000;
    printf("%I64u\n",s);
    return 0;
}

[bo]说明:[/bo]
cout和cin不支持unsigned __int64……
#3
水中无月2008-07-12 17:10
恩,LS正解
还是C语言的printf好用,也好看
那个C++的iostream总觉得不适应
1