i want it to make sure that the info i just typed in, isnt already in the file yeah?
sorry not spaced out. (Mod: well read the announcements then to find out how!)
Code:
void addToDb()
{
char cdnum[3], title[30], artist[25], tracks[3], rel[10];
ofstream outfile;
outfile.open("cddb.dat", ios::app);
if(!outfile)
{
cout<<"\n!!Error opening File!!\n";
}
else
{
cout<<"\nEnter CD: ";
cin.getline(cdnum, 3);
cout<<"\nEnter Album Title: ";
cin.getline(title, 30);
cout<<"\nEnter Name of Artist: ";
cin.getline(artist, 25);
cout<<"\nEnter Tracks: ";
cin.getline(tracks, 3);
cout<<"\nEnter Album Release Date: ";
cin.getline(rel, 10);
outfile<<cdnum<<"/"<<title<<"/"<<artist<<"/"<<tracks<<"/"<<rel<<"/"<<endl;
}
outfile.close();
}