error lnk2019 1 unresolved terminal

declared a function prototype
void readNumbers(ifstream &, int, int);


called function inside main
int main()
{
readNumbers(inputFile, numbers[12], ARRAY_SIZE);
etc.......
}


outside of main stated function
void readNumbers(ifstream inputFile, int numbers[12], int ARRAY_SIZE)
{
etc.....
}

question, i have a feeling it has to do with ifstream &,
ithought since inputFile was a variable of type ifstream
that it would work,
which leads me to ask am i misunderstanding the operand sign ?


sorry detroit,
it still does not compile
Last edited on

readNumbers() is missing the void in front and one argument.
I do not know what you are trying to say,

Post the code in tags please and do not edit the top post, people get confused.

in the prototype decleration ifstream is passed as &

in the function you do not have it as &.( this is the change you made after my comments)

void readNumbers ( ifstream &_______ , int numbers[12], ARRAY_SIZE)
what would you do after &

1
2
3
4
5
6
7
8
9
void readNumbers(ifstrean& inputFile, int numbers[12], arraySize)
{
   // inputFile read the dat in the file, basiclly replaces cin

   inputFile >> numbers
  
   // .........

}
hmm,

same error.
¿what error?
1
2
void readNumbers(ifstream &, int, int); //declaration
void readNumbers(ifstream , int [], int) //definition 
¿Do you see the difference?
yes sir.
function protoype was not declared correct
and function definition was missing the & inputFile after ifstream


thank yall for the help
it runs it runs

Last edited on
Topic archived. No new replies allowed.