This is what I have so far
Now everytime that function runs it will override anything inside the file. I've just added in the infile part because the function needs to read from the file. I need the program to output text onto a consecutive line everytime this function is called without erasing what's previously in there. I haven't learnt how to do this yet.Code:void enter()
{
char mod_name[25], version[10], desc[150], cmds[100];
ifstream infile("modregister.dat");
ofstream outfile("modregister.dat");
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "Module Name: ";
gets(mod_name);
cout << "Version: ";
gets(version);
cout << "Description (less than 150 words): ";
gets(desc);
cout << "Command: ";
gets(cmds);
outfile << mod_name << ' ' << version << ' ' << desc << ' ' << cmds << '\n';
infile.close(); // Tidying up
outfile.close();
}