I have created a list class, that allows the user to create or edit a text file with a list of information inside the .txt file. When I read into the alphabet.txt (a .txt with a list of all the letters), it prints out the letter "z" twice. The editing that the user does is shown between the two "z's." I'm attaching a picture that explains my dillemna.
Another problem is when I print the contents of the file, it does not print the contents of the entire file.
Thank You in advance.
below is a chunk of my List.cpp file.
cout <<"The following files are available for editing: \n";
cout<< "Name the .txt file that you wish to open\n";
cout << "Below displays the content of the file you selected" << endl << endl;
int response, i;
cout << "Enter the number of entries you would like to edit" << endl;
cin >> response;
cout << endl;
for(i=0; i < response; i++)
cout << "Enter your item" << endl;
cin >> a[i];
myFile << a[i] << endl;