ya your syntax for the for loop is wrong..... if u want it to go from 0 to 10 then you would do: for(int i = 0; i <= 10; i++) { //code } sorry if im wrong but this is what i learned in c++ class..... never tried it in gcc