This part should be left to the user of your program no? If the user supplied a file that contains no method, then your program is correct. But if the user supplies a file that contains no methods and your program is returning 1, then there is something you have not accounted for in the program.
Also note that string.find does not return zero to indicate false. It returns string::npos to indicate not found
Actually returning something from your "count()" member function would be a good place to start. Your main function is calling "count()" which in turn calls "methodcout()" but "count()" does not return anything.
Nope, code in C++ will only do what you tell it to. Unless you tell the function specifically to return something, it isn't going to. Computers are great at following directions, but they are stupid too.