On 30/01/2010, at 10:20 AM, hockchai Lim wrote:
printf("num = %017u\n", num);      // the result num =  
00000000000000001
First you declared num as signed but here you're saying it's unsigned.
The real problem is that you need to tell printf() to expect a long  
long. Your code is telling printf() to read only the first 4 bytes of  
the long long value. What do you suppose that might contain?
Fixing both your defects gives:
	printf("num = %017lld\n", num);
Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         OS/400, i5/OS Technical Specialists
   
http://www.flybynight.com.au/
   Phone: +61 2 6657 8251   Mobile: +61 0411 091 400        /"\
   Fax:   +61 2 6657 8251                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------
 
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.