I'm making a program that does accounting. It's a school project that is self directed since I'm the only one in the class. I'm teaching myself.

In the program I store each persons data in a txt file with their username as the name of the file. When they enter the username I add it to a string and add .txt on the end. Poof, the file path to the file I need to read data from is created. I do this

Code:
     ifstream inData;
     inData.open(finalPath);
finalPath is the string with the file path.

The compiler doesn't like this. Since a string won't work, how else can I do this?