Skip to content

Instantly share code, notes, and snippets.

@eienf
Created April 10, 2015 08:38
Show Gist options
  • Save eienf/5e5c6f5772a017f746aa to your computer and use it in GitHub Desktop.
Save eienf/5e5c6f5772a017f746aa to your computer and use it in GitHub Desktop.
printf format string for NSInteger
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSInteger i = 101;
NSLog(@"NSInteger %lu",sizeof(NSInteger));
NSLog(@"long %lu",sizeof(long));
NSLog(@"int %lu",sizeof(int));
NSLog(@"%ld",(long)i);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment