I've a problem with writing to file. If I write something with spaces, it write each word as a single line. Why?
void backstart()
{
    thread t1(backing);
    thread t2(thr2);
    t1.join();
    t2.join();
}
void thr2()
{
    string tmp;
    tmp = "";
    while (tmp != "/exit") 
    {
        cin >> tmp;
        if (tmp != "/exit")
        {
            writefile(tmp);
        }
    }
    runing = false;
}
void writefile(string msg)
{
    ofstream myfile("file.txt", ios::out | ios::app);
    myfile << userna + ": " + msg + ",\n";
    myfile.close();
}
Thanks Damon
 
     
    