I am trying to figure this problem out, for some reason I keep getting this:
no instance of "getline" matches the argument list.
I have looked up this problem and a lot of times its because people use ofstream, or they don't use the ifstream object (if I said that right) has the first attribute to getline. I am quite lost.
#include <string>
std::wifstream myfile;
myfile.open("LaunchLocations.txt");
getline(myfile, gameLaunchtest.directory);
struct gameLaunch
{
wchar_t directory[MAX_PATH];
wchar_t AppName[MAX_PATH];
wchar_t ComboBoxName[MAX_PATH];
}gameLaunchtest;
std::getline()does not support reading into awchar_t[]array, only into astd::stringorstd::wstring(depending on the input stream type). To read into awchar_t[], you need to use thestd::wifstream::getline()method instead: