foo.cpp: In function 'int main()':
foo.cpp:7:10: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto &x: heights)
^
foo.cpp:7:16: error: ISO C++ forbids declaration of 'x' with no type [-fpermissive]
for (auto &x: heights)
^
foo.cpp:7:19: error: range-based 'for' loops are not allowed in C++98 mode
for (auto &x: heights)
^
foo.cpp:10:10: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
for (auto x: heights)
^
foo.cpp:10:15: error: 'x' does not name a type
for (auto x: heights)
^
foo.cpp:13:5: error: expected ';' before 'cout'
cout << answer << endl;
^
foo.cpp:14:1: error: expected primary-expression before '}' token
}
^
foo.cpp:14:1: error: expected ')' before '}' token
foo.cpp:14:1: error: expected primary-expression before '}' token
foo.cpp:14:1: error: expected ';' before '}' token