cout<<"\n Current items in Consoles: \n";
cout<<"\n \t Enter details of product you want to add :";
cout<<"\n \n \t Code : ";
cout<<"\n \n \t Brand : ";
cout<<"\n \n \t Model : ";
cout<<"\n \n \t Cost : ";
cout<<"\n \n \n Are you sure you want to add this product?(y/any other key)";
cout<<"\n New prodcut added to store";
cout<<"\n No changes have been made";
cout<<"\n Press any key to continue...";
As a side, I put the new line at the end of the output rather than the beginning. It is always good to leave the file in a state that you can write to it without having to remember to print a new line first. Also, some computers have trouble with files that do not end in a new line.
Thanks man that fixed the junk values but getline isnt working
it says " no matching function for call to getline(std::istream, char)".
I replaced my character array with string and it compiled but i still had the same problem i had with gets(). I dont get a chance to enter a value