Hey all,
Been a while since I've done any file output, so I'm needing some help here.
I basically just want to save a one line string to a file with the current date and time as the file name. Everything compiles and runs fine, but it just doesn't save.
Any help on why it's not creating the file would be awesome. Thanks!Code:time_t now;
time(&now);
string filePath = "C:\\Kysat\\Ground Station\\Sent Packets";
string fileName = ctime(&now);
fileName += ".txt";
filePath += "\\" + fileName;
string packetString = "";
cout << filePath << endl;
char fullName[100];
for(int i = 0; i < filePath.length(); i++)
{
fullName[i] = filePath[i];
}
for(int i = 0; i < (int)pkt_size; i++)
{
packetString += packet[i];
}
ofstream packetsent(fullName);
packetsent << packetString << endl;
packetsent.close();