I want to pass an input file to a function and within the function, fill an array by reference. It isn't allowing me to do this, it keeps telling me it's expecting a ";" after i in the function. I couldn't really find anything about this in my book - if it can be done and if so, how?
#include <iostream>
#include <fstream>
using namespace std;
// ------ Prototype
void readFile(char [][30], ifstream);
// ****** MAIN ****************************************************************
int main()
{
char weather[3][30];
ifstream inputFile("P4.dat");
return 0;
}
// ------ FUNCTION ------------------------------------------------------------
//
// ----------------------------------------------------------------------------
void readFile(char weather[][30], ifstream inputFile)
{
for(int i = 0; i < 3 i++)
{
for(int k = 0; k < 30; k++)
{
inputFile >> weather[i][k];
}
}
return;
}