编程论坛's Archiver

sunlong 发表于 2008-7-12 12:46

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

#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?还是其他原因,请高手解决下。

linren 发表于 2008-7-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……

水中无月 发表于 2008-7-12 17:10

恩,LS正解
还是C语言的printf好用,也好看[em01]
那个C++的iostream总觉得不适应

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.