I am using private copy constructors to protect my string and binary files.
I am wondering if anybody knows how to write to a binary or string file for input correctly.
Here is the algorithm:
1. Program prompts user to protect the file.
2. If file exists, then a private copy constructor writes over the string or binary without altering it as static.
cout<<"Enter the name of the file you want to protect: ";
cin>>Name;
ofstream fsOut;
fsOut.open(Name, ios_base::out, ios_base::binary);
if(fsOut.is_open())
{
cout<<"Writing to binary file."<<endl;
fsOut<<Name<<endl;
cout<<"File open successful."<<endl;