#include <iostream>
#include <fstream>
using namespace std;
void LOGMSG(string test)
{
ofstream log;
log.open("text.txt");
log << test.c_str();
}
int main()
{
LOGMSG("this is a test");
LOGMSG("this is a test2");
LOGMSG("this is a test3");
}
but it's only writes the last line i mean the last time i called the func!!
how can i make it write every thing every time i call the func?
thnx