“It's not working” == it will not compile. Crank up your compiler warnings to max and look at the top one — this will give you the most important clue. GCC tells me:
a.cpp: In function 'int main()':
a.cpp:19:48: error: no matching function for call to 'std::basic_ifstream<char>::getline(std::__cxx11::string [10], int)'
for (string line[10]; file.getline(line, 10); )
^
It is saying that it cannot find a “getline()” function that takes an array of ten strings and an integer.