When I enter the following, everything works: for (i=0; i < 1000; i++){} But suppose I want a large number, millions, billions etc. for (i=0; i < 1000000; i++){} Then my win32 program crashes, windows says "program not responding" and it can no longer be used. I need to survey ONE TRILLION bytes. How can I make a program repeat the same task over and over again for a very large number without the program crashing or not responding ? Thanks.
I don't know what data type you're trying but you've got upper limits and overflow to worry about. If you really need a loop of that size, try unsigned long long or unsigned _int64 if your compiler supports it. Whatever you're up to, you'd probably be better off thinking of another approach to complete your objective.