hey,
I am pretty new to c++
I am using the dev c++ compiler (if that makes a difference)
Anyway I've been doing a bunch of beginner tutorials and finally reached the part about writing and reading files. Here's the code I'm using
I run this and it does not have any errors. It runs, but nothing actually happens. As I understand it should create a file called asdf.dat with the words hello in it.Code:#include <stdio.h>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
ofstream asdf("C:\asdf.dat");
asdf << "hello";
asdf.close();
return 0;
}
I've looked around at several tutorials, and they're all using this code. If someone can help that would be realy appriciated