Simple while loop

Soldato
Joined
9 Dec 2004
Posts
5,700
Location
Dorset
I've got a simple while loop in C;

int i=1
while (i>0)
{
i=i*1000
}

In theory this should never end, but it does (because i becomes too big). What causes that? I presume this is a computing basic (i.e; "cant handle a number over XXX), but I'm not entirely sure.

Thanks.
 
It looks to me like a snippet of code designed to test your knowledge of the maximum values that you can store store in an int type.

Exactly that, we're looking at code vulnerabilities. Thanks for your input guys.
 
Back
Top Bottom