C++ location of main -
If I main at the top of the main file and open some custom functions, it will tell me that these functions are not Found, but if I put the main under the main file, it will work.
Why? Is it because the compiler parses down from the top and breaks when the main is fixed?
There is nothing to do with the main C ++ compilers work from top to bottom .
Whatever your reference should be declared in advance, goes to the same variable in your case, you can
void foo (); // & lt; - Further announcement, aka prototype ant Main () {foo (); } Void foo () {// here is your FU implementation}
Comments
Post a Comment