hi,
i wrote a simple FOR LOOP program in cocoa-objective c (MAC os- compiler XCode). but it not working properly. the loop iterating only upto some value near to 714300( value change each time running). program is given below.
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
unsigned long long i=1;
for(i=1;i!=0;++i)
printf("%llu\n",i);
printf("finished");
//printf("\n%llu",i++);
//printf("\r%llu",i);
return NSApplicationMain(argc, (const char **) argv);
}
if first printf statement is replaced as printf("%llu-",i); it iterate beyond 1000000 but it run very slowly( take nearly one hour to reach 1000000). what is the problem with this program.
Start Free Trial