I am trying to write a file that writes to a user specified folder using ofstream. The basics of the code looks like this:
#include <iostream>
#include <fstream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int write(int id)
{
ofstream myfile;
myfile.open ("account/"id"/example.txt"); //this is where the error pops up
myfile << "this is what I want written";
myfile.close();
}
int Account()
{
int id;
cout << "Please enter account" << endl;
cin >> id;
return id;
}
int main()
{
int id;
id = Account();
write(id);
return 0;
}
Anyways, hopefully this is an easy question as I havn't programmed since highschool. Thanks in advance.