A function declared using the static keyword can access only the static variable of a class. If a call to a non- static member variable is made in a static function, the compiler will return an error. The syntax to call a static function is
classname::functionname()
A static function is not called using a class object but by using the class name along with the scope resolution operator.