Just curious, why below code is not equivalent to forever loop? Instead application crashes.
unsigned short i;
for (i = 1; i >= 0; i++)
{
printf("%d\n", i);
}
Just curious, why below code is not equivalent to forever loop? Instead application crashes.
unsigned short i;
for (i = 1; i >= 0; i++)
{
printf("%d\n", i);
}
The problem is solved. Antivirus Karspersky was analysing this exe file for nearly 20 seconds it looks. If I disable antivirus, it runs immediately. Thanks for all your inputs.
unsigned short i;
for (i = 1; i >= 0; i++)
{
printf("%d\n", i);
system("pause");
}
Maybe it is so fast that it break , you can use it that make a pause but you need to press enter to keep the loop
unsigned short i;
for (i = 1; i >= 0; i++) {
printf("%d\n", i);
}
This loop will crash when value of i becomes bigger than a short can take.