the name says it all
can you build a function inside a class and then initiate it from main or another location?
Printable View
the name says it all
can you build a function inside a class and then initiate it from main or another location?
Classes contain member variables and member functions.Quote:
can you build a function inside a class
You "execute" functions and "instantiate" objects of a class.Quote:
...and then initiate it from main or another location?
you can use only class methods (functions inside a class) from outside of the class if A) the method is public, B) the object (class instance) is within the scope of the calling function.
Static member functions may be called without an instance of the object.
Quzah.