i6407.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 43 行

C
43
字号
#include <iostream.h>
#include <strstrea.h>

#include "fail.h"

int test( void ) {
    #ifdef __WATCOM_INT64__
    {
	signed __int64 i,j;
	strstream s;

	i = -1234567890123456789I64;
	s << i;
	s >> j;
	if( i != j ) return( 0 );
    }
    {
	unsigned __int64 i,j;
	strstream s;

	i = 1234567890123456789I64;
	s << i;
	s >> j;
	if( i != j ) return( 0 );
    }
    {
	unsigned __int64 i,j;
	strstream s;

	i = 0x1122334455667788I64;
	s << hex << i;
	s >> j;
	if( i != j ) return( 0 );
    }
    #endif
    return( 1 );
}

int main( void ) {
    if( !test() ) _fail;
    _PASS;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?