Is structure can be inherited?

Answer Posted / priya

yes it can be in C++:

#include <iostream>
using namespace std;


struct person
{
private:
char name[20];
int age;
public:
float calsalary();
};
struct emp:public person
{
int empid;
private:
float salary;
float bonus;

};

Is This Answer Correct ?    17 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the characteristics of friend functions?

574


What does h mean in maths?

577


What is a hash function c++?

558


Explain Memory Allocation in C/C++ ?

643


Write is a binary search tree? Write an algo and tell complexity?

601






Do you know what is overriding?

626


Is c++ a difficult language?

583


What is the full form of dos?

573


Can we use struct in c++?

599


Define 'std'.

615


What is a responder chain?

578


Which programming language should I learn first?

583


Explain what are accessor methods?

675


How does a copy constructor differs from an overloaded assignment operator?

566


Difference between delete and free.

623