Output of ofstream

I was learning how to save output of C++ file to .dat file. I followed the following example. But where is the output file saved?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <fstream>
using namespace std;

int main()

{
ofstream out_data("filename.dat");


out_data << "whatever..";





return 0;
}
But where is the output file saved?

in your project folder
for me it saves it in the directory where my project files are saved.
Last edited on
Topic archived. No new replies allowed.