Created
July 25, 2010 01:31
-
-
Save livid/489173 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int foo(int start, int end) { | |
NSLog(@"Hello"); | |
int result; | |
int i; | |
int max = end + 1; | |
for (i = start; i < max; i++) { | |
result = result + i; | |
} | |
return result; | |
} | |
int main(int argc, const char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
int result1; | |
result1 = foo(1, 100); | |
int result2; | |
result2 = foo(1, 100); | |
NSLog(@"result1: %d", result1); | |
NSLog(@"result2: %d", result2); | |
[pool drain]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment