Ok need some help. I have read in a file to an array. I need to take the array and format it so that the numbers are formatted. The text file is just a list of numbers. For example, I need to take the first two numbers and format them so that it is printed out to the console like this: "1-0". Here is my code so far. Notice the incomplete function where the formatting should take place.
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<fstream>
using namespace std;
string ArrayFormat(int array[]);
int main() {
const int ARRAY_SIZE = 21;
string filename;
ifstream inputfile;
int score[ARRAY_SIZE];
cout <<"\nPlease enter the name of a file: ";
cin >> filename;
inputfile.open(filename.c_str());
if (inputfile.fail()){
perror(filename.c_str());
exit(1);
}// end of error test
for (int i=0;i<20;i++){
inputfile >> score[i];
// cout << score[i] << endl;
}// end of for loop to read into array
inputfile.close();
}// end of main
string ArrayFormat(int array[]){
for(int i=0; i<=21; i++){
}
}// end of ArrayFormat