
Patrick B. answered 07/22/20
Math and computer tutor/teacher
Methods are member functions inside the class that operate on the private data members.
Rule of thumb is that if a procedure , process, set of steps, or block of code is going to
have to be written more than once, then it should be put into a subroutine...
The compiler shall tell you what order they belong... if you put them out of order, the
compiler will not recognize the procedure causing an error.
Here is an example:
//** WILL CAUSE A COMPILER ERROR because the header of function B has not been seen *//
#include <stdio.h>
void A()
{
printf(" Function A \n");
printf(" calling B... \n");
B();
}
main()
{
A();
}
void B()
{
printf(" function B...\n");
}
//*******
Instead, function B should be the first function listed since A calls B, and main calls A
*********/