+ 1
What is the use of static member functions in class?
i know how static data members work but i couldn't figure out how static member functions come in handy someone pls give a possible purpose for it thanks in advance
1 Answer
+ 1
Static members, just as static classes, dont belong to any objects. So they are something like stand-alone members or classes which can be called anytime anywhere (as long as they are declared as global members or global classes i guess). So performing some operations on different variables or class members of the same datatype requires unique methods, which don't belong to any objects. That's where static members come in handy.