This works for me. Basically, you'll want to use the string class to easily add the two strings together. You can make
uniquePart
a char* if you like, but unless you want to get messy with c-style strings, you should ensure
path
is a std::string.
#include <iostream>
#include <fstream>
using namespace std;
#define definedVar "c:/"
void someFunc(string uniquePart)
{
string path = definedVar;
path += uniquePart;
ofstream myFile;
myFile.open(path.c_str());
myFile.close();
}
int main()
{
someFunc("/someFile.dat");
return 0;
}