Textfile Named Testfiletxt Using Template Write Program Passes Array Main Function Reading Q43878171
I have a textfile named testfile.txt Using the template I havebelow write a program that passes an array to the main() function.Reading 10 names off the text file then sorting themalphabetically.
#include <iostream>
#include <fstream>
#include<string>
#include<limits>
void selectionSort(string values[], int size) { int startScan;int minIndex; string minValue; for (startScan = 0; startScan <(size – 1); startScan++) { minIndex = startScan; minValue =values[minIndex]; for(int index = startScan + 1; index < size;index++) { if (values[index] < minValue) { minValue =values[index]; minIndex = index; } } values[minIndex] =values[startScan]; values[startScan] = minValue; } }
main()
{
}
Expert Answer
Answer to I have a textfile named testfile.txt Using the template I have below write a program that passes an array to the main() …
OR