• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Outputting an unsigned long long
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outputting an unsigned long long


  • Subject: Re: Outputting an unsigned long long
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Thu, 20 Jun 2002 23:10:44 -0700

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.

  • Follow-Ups:
    • Re: Outputting an unsigned long long
      • From: Clark Mueller <email@hidden>
    • Re: Outputting an unsigned long long
      • From: Sherm Pendley <email@hidden>
References: 
 >Re: Outputting an unsigned long long (From: Clark Mueller <email@hidden>)

  • Prev by Date: Re: Replacing contents of NSTextView...
  • Next by Date: Re: NSData weirdness...
  • Previous by thread: Re: Outputting an unsigned long long
  • Next by thread: Re: Outputting an unsigned long long
  • Index(es):
    • Date
    • Thread