Skip to content

Instantly share code, notes, and snippets.

@wavebeem
Created March 11, 2011 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wavebeem/865587 to your computer and use it in GitHub Desktop.
Save wavebeem/865587 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
#define I(n) [NSNumber numberWithInt:(n)]
int
main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *ary = [NSArray arrayWithObjects:
I(4), I(5), I(1), I(0), I(6), nil
];
int i;
for (i=0; i < [ary count]; ++i) {
id elem = [ary objectAtIndex:i];
int m = [elem intValue];
printf("%d ", m);
int j;
for (j=0; j < m; ++j) {
fputs("=", stdout);
}
putchar('\n');
}
[pool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment