Dear all,
I need your help on tis programming assignment I have.
I need to save all the atrributes information to a signle file.
I need to have 2 options :
Save to a default name backup.bak and to a users filename choice.
I have found this code in an ebook
#include <fstream.h>
main()
{
ofstream file_ptr; // Declares a file pointer.
file_ptr.open(“house.dat”, ios::out); // Creates the file.
if (!file_ptr)
{ cout << “Error opening file.\n”; }
else
{
// Rest of output commands go here.
The pseudocode I wrote haas the following structude.
I will call a function called backup()
I will create a menu with 2 options
Save to a default location with default name : "C:\Backup\backup.bak"
Save to a default location C:\Backup\ with a users filename choice
so
cout<<"Enter your choice"<<endl;
cin >>choice;
if (choice==1){}
else if (choice==2){}
else if (choice==3){return 0;}
else {cout<<"Please enter a valid choice"<<endl;}
I need your help how I am going to save all the obects I have created in all classes I have created.