I am so lost. I've finished the other 90% of my assignment, but I am stuck.
I have a csv file and I have to use it to fill a double 2d array. I know that I first have to make it into a string and then convert the string to an array(I was given the function for that). What I have so far obviously doesn't work. But the problem is that I can't use libraries like sstream, fstream, etc. Only string and cstdlib (and iostream).
void csvReader(double num[][2], string filename){
ifstream mydata("Values.csv");
mydata.open();
if (mydata.is_open()) {
while (getline(mydata, filename, ',')){
}
strToDouble(filename); // a function that will convert from string to double
for (unsignedint i = 0; i<filename.length();i++){
filename[i]=num[i][2];
}
mydata.close();
}
else cerr << "Could not open file";
}
I also have to do the opposite, where I take an array and insert the values into a csv but I didn't even know where to start.