You would need an instance of A to use function f.
Normally, you would only make a class function a member function if it needed to operate with an instance of the class. If it fits as part of the class but doesn't need to operate with an instance of the class, make it static.
Function A::f() is not a static member. So it requires an implicit object parameter that is this. So you cannot call it without specifying an object of class A. That is the call should look like
Thanks for the info. In my main.cpp file, I create an instance of class A (call it A_instance). When I create A_instance, I don't need to call f in main.cpp for what I'm trying to do here (but I do need to call f in main for other parts of my main.cpp file). (So, I don't think I can make f static.) In main, I also create an instance of class B, and I need to call g inside main (of course, using f in g). How do I create an instance of A in g?
#include "A.h"
#include "B.h"
A a; create an instance of class A
B b; create an instance of class B
b.g(const A &a); // call g from instance b, sending in a pointer to instance a