What is static function and static class?

Answer Posted / anthony michael

Static function and static variable does not below to single
instance of a class.

To access static functions we don't need instance of a class
instead it can be accessed using the class name followed by
::operator as:
[class_name::static_function() ]

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of seekg in c++?

592


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

601


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

631


Which software is used for c++ programming?

610


Why is c++ still best?

547






Does dev c++ support c++ 11?

545


What is null pointer and void pointer and what is their use?

580


What is data types c++?

536


How do you find out if a linked-list has an end?

641


Difference between struct and class in terms of access modifier.

690


Mention the storage classes in c++.

636


Does c++ support multilevel and multiple inheritances?

543


Can union be self referenced?

569


Are c and c++ different?

531


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

630