I'm trying to write a program that initializes an array of names in the format: "Xxxx, Yyyyy" where x is the letters of the last name and y is the letters of the first name. The array will have 20 names in that format. Now I tried writing a function to print them.. How do i make them come out in either rows of 3 or 4s or in a list straight down? Also, I'm trying to print and sort them in alphabetical order using the "selection sort" method.
My function that prints names: *updated*
If you want to print them one per line, put the cout << endl part inside the loop body
If you want to display some in a row, use a condition to output the newline. Hint i%4 returns 0 if i is divisible by 4
Oh god... that was so simple! I feel so retarded... Thanks!
Now I have to figure out how to arrange them in alphabetical order based on their last names...