Need Help in a function i created

[Error] invalid types 'double[double]' for array subscript

................................................................................

void getInput(ifstream& inFile, double studentId, double matMark, double engMark, double phyMark)
{
string fileinputname = "result.txt";
double i = 0.0;

inFile.open(fileinputname.c_str());
if (inFile.fail()) // check for successful open
{
cout << "\nThe file was not successfully opened"
<< "\n Please check that the file currently exists."
<< endl;

exit(1);
}

while (inFile.good())
{
inFile >> studentId >> matMark >> engMark_>> phyMark*;
i++;
}
inFile.close();
}*_

A complete and real Arduino program would have a setup() function and a loop() function, both declared void.

We want to see complete programs and complete error messages that are copied and pasted. If you want to post snippets, please see http://snippets-r-us.com/

double[double] means you are trying to use a double-precision floating-point number as the index of an array. (An array of doubles.) The compiler can store lots of things in an array but when you try to extract the item numbered 1.27 then the compiler can't guess if you really meant item 1 or item 2. It certainly can't give you a blend of those two items.

Change the expression indexing the array (inside the [] square brackets) into an integer type.

Note that most Arduinos use single-precision anywhere you specify double. So if your algorithm depends on the extra precision of double, then you need to look very carefully at what you are doing and what you are doing it with.