void addname(string name)
{
ofstream myfile(CONTACTS,ios::app );
myfile.open(CONTACTS);
if (myfile.is_open());
{
myfile<<i++<<name<<endl;
myfile.close();
}
}
Initially the codes just kept on overwriting the existing file, but after that i was told to put ios::app. However, it is still now working....now even worse...ofstream is not even writing the file...hellp..