Derived class is struct, then default visibility mode is public - Inheritance

Q.  If the derived class is struct, then default visibility mode is _______ .
- Published on 19 Jul 15

a. public
b. protected
c. private
d. struct can’t inherit class

ANSWER: public
 

    Discussion

  • Dimpy gora   -Posted on 10 Apr 21
    Base class struct then Visibility mode is ..?
  • Sakshi   -Posted on 10 Apr 21
    I want to a C++ (computer science)
  • Raj   -Posted on 08 Oct 15
    The default accessibility is public for struct.
    Example:

    struct A
    {
    void show() // default accessibility is public
    {
    cout<<"structure demo\n";
    }
    };
    struct B: A
    {
    // Implementation here
    };

    void main()
    {
    B obj;
    obj.show();
    }

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)