I just made a program to count the lines of a text document, the address of which is in the actual code. Now its my goal to have the user input the address and count the lines of that document. I tried to do this using a pointer but it is throwing an error:
"no matching function for call to 'std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::_Ios_Openmode&)'|"
Before C++11 it was not possible to pass std::string to std::ifstream. It had to be a C string (char*). std::string has a member function c_str() that returns a C string that you can use. ifstream myInputFileStream(pString->c_str() , ifstream::in);