Main.cc: In function 'int main()': Main.cc:8:12: error: 'i' was not declared in this scope int max=a[i]; ^