I've created them first in /tmp, and executed and nothing. Then in /home and again nothing. I also tried to explicitly close the files with file.close();... Yeah I think that something's wrong with the kubuntu. Many thanks though :-)

I meant that you should write ofstream file("/tmp/F1.txt",ios::trunc);
Not sure if that's what you did.

Yes, I did exactly that. I also tried it in /home/ directory but no luck.

Actually don't bother. I think the problem is my kubuntu (or the virtual box or something). Because I executed this simple test and it didn't worked:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
        string message = "Testing";

        ofstream out("file1.txt", ios::trunc);

        out << message << endl;

        out.close();

        return 0;
}

Thanks for all your help, and sorry if i was a pain :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.