How to see if a user already has a file? For example, I want this to make a text file and if a user already has a file in their system for it not to work and send an error.
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int number;
cout << "This is just a test. Insert the number 10 to make it work" << endl;
cin >> number;
if (number == 10) {
ofstream read("read.txt");
}
}