Why does this not work, and are there other alternatives?
This will eventually be used in a loop of sorts.. the different fileName's will be determined by the program in real time..
#include <fstream>
#include <iostream>
int main (int argc, char** argv)
{
std::string fileName;
fileName = "testFile.txt"; // passed to program at runtime
std::ofstream output;
output.open(fileName); // path of ofstream = string fileName
output << "success";
output.close();
return 0;
}
:?: