Here is my code that I have written to read an excel file in csv format in C++. I want to read the file line by line. When I run the code it gives me an error saying
argument list for class template 'array' is missing
Thanks.
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <array>
using namespace std;
int main() {
array<string , 29>arr;
string line;
int location;
int start = 0;
//int arrayFile[51][28] = { { 0 } };
string fileName;
ifstream infile(fileName);
infile >> line;
//error check
if (infile.fail()) {
cout << "File not Found !" << endl;
exit(1);
}
//reading the file
for (int i = 0; i < 29; i++) {
location = line.find(","); //find the first comma in line
array[i] = line.substr(start, location - start); // separate the information from line up to the comma
line = line.substr(location + 1); //change line to the rest after removing the the abouve piece of the information
}
array[i] = line;