C++ | Static Keyword | Question 6

Last Updated :
Discuss
Comments

Output of following C++ program?

CPP
#include <iostream>
class Test
{
public:
    void fun();
};
static void Test::fun()   
{
    std::cout<<"fun() is static\n";
}
int main()
{
    Test::fun();   
    return 0;
}

Contributed by

Pravasi Meet

fun() is static

Empty Screen

Compiler Error

Share your thoughts in the comments