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 can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

560


What are the steps in the development cycle?

615


What are the advantages of c++ over c?

584


What is class syntax c++?

595


What is c++ and its uses?

624






How did c++ start?

613


What is an object in c++?

614


What is malloc in c++?

557


What are guid? Why does com need guids?

570


What is a character in c++?

565


Define a constructor?

592


Explain bubble sorting.

628


Difference between a homogeneous and a heterogeneous container

661


Write my own zero-argument manipulator that should work same as hex?

587


What is binary object model?

602