Whenever I use decimals in my code, it doesn't work. Is it perhaps the IDE I'm running it on? Or perhaps is it because I'm on a Mac?
I'm running it on Code::Blocks on a Mac.
The code is..
1 2 3 4 5 6 7 8 9 10
int x;
for (x=10; x<=20; x+.1)
{
cout << x << endl;
if (x == 15)
{
cout << "The loop has been broken before it's reached 20!" << endl;
break;
}
}
This is not the complete code. This is part of a really messy 100ish line code I'm using as my testing code. There are no errors building it or running it, however, while it's running the loop never ends. It continues to print out 10 rather than 10.1.