The following code writes to a file on either local disk to a remote disk (commented out code) on Windows 7 platform.

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

int main () 
  ofstream outfile; ("test.txt");
  // ("\\\\server/temp/test.txt");
  outfile << "Hello world";
  return 0;
The documentation does not specify what is a valid filename (path and filename). For example, will the "\\\\server\temp" path work on all operating systems to access a samba share? Does the constructor accept forward and backward slashes as folder separator on all operating systems?