What is a static member?

devquora
devquora

Posted On: Feb 22, 2018

 

Static is a keyword in C++ programming used to give unique characteristics to an element. The static elements are allocated storage only once in an entire program lifetime in the static storage area. Also, they have a scope for the span of the program lifetime. Static member functions do not have this pointer, and they cannot be of a virtual type.  Member method declarations with the same name and the name parameter-type-list cannot be overloaded if any of them is a static member function declaration. Furthermore, a static member function cannot be declared as const, volatile, or const volatile.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..