What is static function and static class?

Answer Posted / brainless

If compilers don't check your pointers strictly,
you can also write code as below,

class A
{
//some static function code here
//never access non-static attributes here
static void callMe() {}
};

int main()
{
A * inst = NULL;
(*inst).callMe();
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who invented turbo c++?

831


What is searching? Explain linear and binary search.

783


What kind of problems can be solved by a namespace?

799


Can you please explain the difference between static and dynamic binding of functions?

760


What are multiple inheritances (virtual inheritance)?

797


What is scope in c++ with example?

829


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

841


What is enum class in c++?

931


What is polymorphism and its type in c++?

780


Is c++ a float?

794


What is the use of pointer in c++ with example?

773


What is the best it certification?

820


How can you quickly find the number of elements stored in a static array?

838


Describe private, protected and public – the differences and give examples.

828


What does I ++ mean in c++?

786