How to make an infinite loop in C .If I am using while for example??
How to make an infinite loop in C .If I am using while for example??
Code:while (1) { printf("forever"); }
Thanks!
That perfectly worked
Code:for(;;) { printf("Alternative infinite loop.\n"); }
Code:Loop: printf( "Infinite loop with goto." ); goto Loop;
I like doing it this way:
Code:#define forever while(1) forever { printf("loop\n"); }
I do not think it is worth the trouble though. for (;;) and while (1) are universally recognised as deliberate infinite loops.I like doing it this way:
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thanks guys You are all great!! and so are your suggestions