What is the use of static functions?

Answer Posted / khan

Static member functions give internal linkage. The function
declared as static is not visible outside the file in which
it is declared. It is not associated with "this" pointer and
it can be invoked using class name instead of depending on
individual object. It can access only static members of the
class.

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When there is a global variable and local variable with the same name, how will you access the global variable?

844


Will c++ be replaced?

808


What is the difference between a "copy constructor" and an "assignment operator" in C++?

813


Can the creation of operator** is allowed to perform the to-the-power-of operations?

756


What is the extraction operator and what does it do?

796






Explain rethrowing exceptions with an example?

774


Do the names of parameters have to agree in the prototype, definition, and call to the function?

797


Can we use this pointer inside static member function?

808


Is sorted c++?

849


What do you mean by overhead in c++?

788


What is c++ stringstream?

836


If a header file is included twice by mistake in the program, will it give any error?

767


How are virtual functions implemented in c++?

787


Is set c++?

745


Is std :: string immutable?

750