Advertisement

10.09.2007 at 02:44AM PDT, ID: 22880851
[x]
Attachment Details

for loop not iterate more than 800000

Asked by tariq6000 in Objective-C Programming Language, Miscellaneous Programming, Tiger (Mac OS 10.4)

Tags: loop, objective, c

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
 
Loading Advertisement...
 
[+][-]10.09.2007 at 03:48AM PDT, ID: 20039732

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2007 at 03:43AM PDT, ID: 20047359

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2007 at 06:23AM PDT, ID: 20070921

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Objective-C Programming Language, Miscellaneous Programming, Tiger (Mac OS 10.4)
Tags: loop, objective, c
Sign Up Now!
Solution Provided By: fridom
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.13.2007 at 07:11AM PDT, ID: 20071033

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.20.2008 at 06:19AM PST, ID: 20937915

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628