> Code blocks keep scrachsing C++?

Code blocks keep scrachsing C++?

Posted at: 2014-12-18 
int readData(char const *inputFile, double values[], int MAX) , is there a missing ; at the end of this?

iFile>> test;

No semi colon wanted.

Hint: Always put the compound statement, even if it's a single line or another conditional, in curly brackets and always indent.

So why have you not told the program where to look for the file or files it can not find?

const int ERR_NO_FILE = 0x0100; //Input file does not exist

const int ERR_EMPTY_FILE = 0x0200;

const int ERR_LESS_THAN_MAX3 = 0x0400;

const int EQUAL_TO_MAX3 = 0x0800;

const int ERR_MORE_THAN_MAX3 = 0x1000;

const int ERR_EOF_NO_MAX3 = 0x2000;

const int ERR_INPUT_FAIL = 0x4000;

const int ERR_INPUT_OUT_OF_RANGE = 0x8000;

#include

#include

#include

using namespace std;

int readData(char const *inputFile, double values[], int MAX);

void displayDataTable(double [], int numTrip);

int main0()

{

return 0;

}

int readData(char const *inputFile, double values[], int MAX)

{

int x=0;

int Error=0;

double a;

int loop=0;

double test;

fstream iFile;

iFile.open(inputFile, ios::in);

if (iFile.fail()) {

Error+=ERR_NO_FILE ;

} else {

iFile>> test;

if (iFile.eof())

Error+=ERR_EMPTY_FILE;

}

while (!iFile.eof())

{

if(values[x] < 0.0)

Error += ERR_INPUT_OUT_OF_RANGE;

if(values[x] > 10000.00)

Error += ERR_INPUT_OUT_OF_RANGE;

values[x]=a;

x++;

++loop;

}

if (loop==MAX)

Error+=EQUAL_TO_MAX3;

if (loop
Error+=ERR_LESS_THAN_MAX3;

if (loop>MAX)

Error+=ERR_MORE_THAN_MAX3;

if (x%3!=0)

Error+=ERR_EOF_NO_MAX3;

cout<
return Error;

}