Hi guys I am working on an rpg project and I am creating player files so they can save their progress and such.
I've made a test program so I can show you on a more simple scale of what I am looking for
Code:
#include <iostream>
#include <fstream>
#include <string>
int main(){
std::string PlayerFileName;
std::cout << "Name Your Player File Name: ";
std::cin >> PlayerFileName;
std::ofstream outputFile;
std::string FileName = "Players/" + PlayerFileName;
outputFile.open(FileName); // This creates the file
// ...
}
I want to check and see if the Player File Name already exists the the Players directory so people cant save over their progress.
Thanks!