why does this code work, but if the main function is before the rest of them, it won't compile? i don't understand why "main" has to be on the bottom! very puzzling.
==============================
Code:
#include <iostream.h>
int one()
{
cout <<"you picked one!" <<endl;
return 0;
}
int two()
{
cout <<"you picked two!" <<endl;
return 0;
}
int three()
{
cout <<"you picked three!" <<endl;
return 0;
}
int main()
{
int pick;
cout <<"Pick 1,2, or 3: " <<endl;
cin >> pick;
if (pick==1)
{
one();
}
if (pick==2)
{
two();
}
if (pick==3)
{
three();
}
return 0;
}
===========================================