I was working on a little C++ project at home, which I brought into school to show my teacher. At home I have Visual Studio 2012, whereas the school computers have Visual Studio
Foreach loop was introduced in the C++11 standard, the compilers at your school probably aren't up to date with the new standard.