ofstream not writing?

Hi, I have code to write to a file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
	
         char buffer[100000];
	
	int nDataLength = recv(Socket,buffer,100000,0);
	ofstream f;
	f.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
	try
	{
	
	
	       f.open("C:\out\src.txt");
	       f << "a" << endl;
	       f << buffer;
	       cout << buffer;

	       closesocket(Socket);
                WSACleanup();
	       f.close();
	}
	catch(ofstream::failure e)
	{
	       std::cerr << "Exception opening/reading file";
	}


buffer is a char buffer holding code from a website. It prints it out to cout, and this is visible. However, the file is not written to, neither in line

f << buffer;

nor in line

f << "a" << endl;

This usually works on my machine. No exceptions are thrown in above code. Am I missing something? How can this not be working?
ah, it was the directory delimiters, open() uses "/", not "\". I was hoping an exception was to be thrown so I could get to this easier, but anyay, it worked eiher way :)
Topic archived. No new replies allowed.