Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing __int64; 1

Status
Not open for further replies.

shanlon

Technical User
Dec 4, 2000
24
IE
How does a person print an variable that is __int64 big..
using printf with the %d conversion character will print __int8, __int16 and __int32 but not the __int64.
I know it all depends on whether the compiler supports __int64 sized variables but i presume it must since i don't get an error when declaring variables of this type.
Is it a case of printing the low part and the high part seperately (i think __int64 is a struct)?
I'm using VC++, and these are HEX numbers also.

Also is there a function in VC++ to convert an OEM string into it's equivalent ANSI string????





 
About the first question, please give the following a shot.

char cDecNum[ 128 ];
char cHexNum[ 128 ];
__int64 n64BigNum = 12345678901234;
sprintf( cDecNum, "%I64d", n64BigNum );
sprintf( cHexNum, "%I64X", n64BigNum );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top