Change to:
file.open(name.c_str());
or just use the constructor as there is no reason to separate construction and open:
std::ifstream file(name.c_str());
Support for std::string
argument was added in c++11.
As loadNumbersFromFile()
does not modify its argument pass by std::string const&
to document that fact and avoid unnecessary copy.