you are asked to read 10 names (String type) from an input file let's call it in.text, save it to an array
(called name [10]), sort them (alphabetically). Print the result to an output file calls it out.txt you need
to use bobble sort algorithm.
Here is my problem, my output shows only 9 names on the list, and sometimes one of the names shows more than once.
First fundamental issue:
How many elements does the "names" contain at line 26? You don't check.
Nevertheless, you do assume some number in the following loops.
You do appear to sort the list twice for no reason. Sort first, then output to the two destinations (outfile and cout).
To your question: You do print elements [1-9]. That is 9 values.
I have long forgotten the algorithm for bubble, so I just have an eerie feeling about your implementation.