#include <stdlib.h>
....
double returnDistance(string coord1, string coord2, const vector<string> vec) {
int arr1[11], arr2[11];
istringstream iss1(coord1);
int i = 0;
while(iss1) {
iss1 >> arr1[i];
i++;
}
istringstream iss2(coord2);
i = 0;
while(iss2) {
iss2 >> arr2[i];
i++;
}
//error below when calling atof
return calculateDistance(atof(arr1[6]), atof(arr2[6]),
atof(arr1[7]), atof(arr2[7]),
atof(arr1[8]), atof(arr2[8]))
}
arr1[] and arr2[] are both arrays of strings and calculateDistance calculates the 3-D distance given x, y, z coordinates, but for some reason I get the error that "No matching function for call to 'atof'". Help please!
PS: I get the following error when I try using .c_str(): "Member reference base type 'int' is not a structure or union"