devxlogo

How to Print an __int64 Number in VC++

How to Print an __int64 Number in VC++

You can use the printf() function as in the following example:

 #include using namespace std;int main(){  __int64 i64 = 4294967296;  printf("%I64d
", i64); //in decimal  printf("%I64x
", i64); //in hexa  return 0;}

You can also use the function Int64ToString(). The next example transforms an __int64 into a string in a specified radix:

 #include #include #include string Int64ToString(__int64 const& ri64, int iRadix=10){  bool bNeg = (ri64 

devx-admin

Share the Post: