[Gllug] Somewhat OT - (GNU) C++

Dan Kolb gllug at eco.li
Mon May 24 14:50:49 UTC 2010


On Mon, May 24, 2010 at 03:47:08PM +0100, Adrian McMenamin wrote:
> Am I losing my marbles or is GNU g++ broken when this code:
> 
> #include <iostream>
> using namespace std;
> 
> int main()
> {        
>          for (int x = 90; x > 20; x--)
>          {       cout << x << " ";
>          }
> }
> 
> outputs integers in reverse order from 90 to 21??

What do you think it should do? It looks like it's designed to output the
numbers 90 down to 21....

Dan

-- 
Look out!  Behind you!
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list