A C++ problem about arrayI am a beginner of C++ programming. When I am learning the array, I copied a program from a book and cannot be executed. I don't know what is wrong? Please help me!!!
#include
void main()
{
int max_element();
int n, a[10];
int max;
for(n=0; n>a[n];
max=max_element(a, 10);
cout (more...)
You should declare the function before you use it
main() is an exception. All the other functions need to be declared before use. Just put your function prototype at the beginning of the program.
BTW: It's better to use <iostream> than <iostream.h>
BTW: It's better to use <iostream> than <iostream.h>
Yeah!