Hi all...
I'm having some trouble with a code that I just started. I need to use an array to store 10 user values. Then I need to use a function (highLow in this case) to choose the largest and smallest number from the 10 and display them. SO far this is all I have but I keep getting an error "error C3861: 'highLow': identifier not found"... I thought that I had to use "#include <iostream.h>" but I guess not because it didn't work either. Any feedback and pointers would be appreciated.
Thanks!
You need a forward declaration for highLow(). At the time the compiler reads line 10, it doesn't know what the calling sequence for highLow() should be.
Line 10: That's not the correct way to pass an array. You're trying to pass the 11th element of the array, which is out of bounds.
Line 14: The argument to highLow() should be an array of ints. Not a single int.
I thought that I had to use "#include <iostream.h>"
<iostream.h> is deprecated. <iostream> is the standard header.
The compiler is processing a file (almost) line by line.
It does reach line 10 and encounters a new word "highLow".
* That is not a language keyword.
* That was not declared/introduced within file 'iostream'.
* That was not declared/introduced in lines 2-9 of this file.
So what is it? There has been no clue. Because the compiler does not know, it says "error".
There are two solutions. One is to move the lines 14-17 to before line 5.
A better one (and which the file 'iostream' is about too) is to keep the lines 14-17 where they are and insert a function declaration before line 5.