Question 1.will cin.getline()only stream in 1 line, instead of cin >> file, and if so,how do you go about this with alphabetizing.. What I am thinking is: cin.getline() will stream in 1 line, maybe at a time, and then you can call the swapNames function after the first cin.getline(), and if that second line's first int is smaller than the first lines, switch the second line to the first.
How about read in each line and sort the lines using the bubble sort. You already suggested it.Question 2. How do i go about converting the char array that has the text file in it, into integers. I've never had to do this, and I've heard it makes the process easier using int.Good question. What integer would you convert "Jones, Frederick M" into?
And stop thinking in terms of character arrays. You already posted that you should "use the C++ string class." That solves all of your questions in one C++ type.
WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944