Create a file using classes help
Hello, I am trying to create a program on the cpp droid that will create a csv file and write out onto it. The program runs through just fine, but no file is created which is the ultimate goal. Does anyone see what I could be doing wrong? I would greatly appreciate the help. Thank you P.S. I have looked through various questions and tried loading my program code onto the compiler here, the C++ Shell online, and online GDB, but to no avail. Apologies for the long code below. CODE: #include <iostream> #include <string> #include <iomanip> #include <fstream> using namespace std; class FileCreator { ofstream MyFile; public: FileCreator(string); void WriteFile(string, double, double, double, double, double); void WriteHeader(); void CloseFile(); ~FileCreator(); }; inline FileCreator::FileCreator(string title) { ofstream MyFile; cout << "Please enter a title for the document" << endl; cin >> title; title += ".csv"; MyFile.open("./Internal storage/Documents/title.c_str()", ios::in | ios::out | ios::trunc); } inline void FileCreator::WriteFile(string StoreName, double JanSales, double FebSales, double MarSales, double AprSales, double TotalSales) { ofstream MyFile("./Internal storage/Documents/title.c_str()"); TotalSales = JanSales + FebSales + MarSales + AprSales; MyFile << StoreName << ", " << JanSales << ", " << FebSales << ", " << MarSales << ", " << AprSales << ", " << TotalSales << "\n"; } inline void FileCreator::WriteHeader() { ofstream MyFile("./Internal Storage/Documents/title.c_str()"); MyFile << "Store" << ", " << "January" << ", " << "Feburary" << ", " << "March" << ", " << "April" << ", " << "Total" << "\n"; } inline void FileCreator::CloseFile() { ofstream MyFile("./Internal storage/Documents/title.c_str()"); MyFile.close(); } inline FileCreator::~FileCreator() { } int main() {