The above snippet is from http://www.cprogramming.com/tutorial/lesson4.html ...Code:#include <iostream> using namespace std; int mult ( int x, int y ); int main() { int x; int y; cout<<"Please input two numbers to be multiplied: "; cin>> x >> y; cin.ignore(); cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n"; cin.get(); } int mult ( int x, int y ) { return x * y; }
Why are prototypes used? wouldn't it be cleaner too write the functions before the required one? I'm confused on why they are needed.
If someone could explainI didn't see it mentioned in the tutorial of why so I ask here.



LinkBack URL
About LinkBacks
I didn't see it mentioned in the tutorial of why so I ask here. 



