Re: Outputting an unsigned long long
Re: Outputting an unsigned long long
- Subject: Re: Outputting an unsigned long long
- From: Clark Mueller <email@hidden>
- Date: Fri, 21 Jun 2002 08:42:29 -0600
Yeah, that does the trick; excellent. Thanks to everybody who replied!
Clark
On Friday, June 21, 2002, at 12:10 AM, Timothy J. Wood wrote:
On Thursday, June 20, 2002, at 08:54 PM, Clark Mueller wrote:
I am having a problem outputting an unsigned long long, and I am at a loss as to how to remedy the problem. I create an NSString using the ANSI formatters:
Try %qd, %qu or %qx:
#include <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
unsigned long long foo = 0x123456780abcdef0ULL;
printf("%qd\n", foo);
NSLog(@"%qd\n", foo);
printf("%qx\n", foo);
NSLog(@"%qx\n", foo);
printf("%qu\n", foo);
NSLog(@"%qu\n", foo);
return 0;
}
produces:
1311768465047871216
2002-06-20 23:09:38.299 foo[27082] 1311768465047871216
123456780abcdef0
2002-06-20 23:09:38.300 foo[27082] 123456780abcdef0
1311768465047871216
2002-06-20 23:09:38.300 foo[27082] 1311768465047871216
-tim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.