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

How do I start a c++ project?

598


what is a class? Explain with an example.

630


What are shallow and deep copies?

647


Incase of a function declaration, what is extern means?

528


Explain how a pointer to function can be declared in C++?

588






Is it possible to pass an object of the same class in place of object reference to the copy constructor?

579


Can char be a number c++?

608


How can I learn dev c++ programming?

578


How to get the current position of the file pointer?

561


When must you use a pointer rather than a reference?

612


Which is better c++ or java?

577


what are the iterator and generic algorithms.

1493


How does class accomplish data hiding in c++?

666


What are the uses of pointers?

591


What are c++ redistributables?

570