from the function tutorial on this site, I understand how they work but what I dont get is the placement of it, for example
In the example on the tutorial it had return at the end but that's for making blueprints of a program so I put it with the mult function before main() and it worked but I tried sticking main in front of the mult function and the program no longer works and im getting errors such as a parse error before int on the 3rd line, but why?Code:#include <iostream> int mult(int x, int y) {return x*y;} int main() { int x,y; std::cin>>x>>y; std::cout<<mult(x,y)<<std::endl; system("PAUSE"); return 0; }



LinkBack URL
About LinkBacks


