View Single Post
  #4 (permalink)  
Old September 30th, 2004, 09:43 AM
davekw7x davekw7x is offline
Authorized User
 
Join Date: Feb 2004
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, here's what I ran with gcc on my Windows XP box
Code:
/* Use of 64-bit unsigned ints with gnu cc */

#include <stdio.h>                                    
typedef unsigned long long Long;
int main(void)                                       
{                                                     
   Long juul = 123456789012345678LL;    
   unsigned char *pjuul;                              
   int i;                                             

   printf("sizeof(Long) = %d\n", sizeof (Long));
   printf("juuld: %lld\n",juul);
   printf("juulx: %016llX\n",juul);                     
   pjuul = (char *) &juul;                            
   printf("juulb: ");                                 
   for (i = 0;i < sizeof(Long); i++) printf("%02X",*(pjuul + i));
   printf("\n");                                      
   return 0;
}
Here's what I got:

sizeof(Long) = 8
juuld: 123456789012345678
juulx: 01B69B4BA630F34E
juulb: 4EF330A64B9BB601

This is what I expected.


Regards,

Dave
Reply With Quote