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 is the use of cmath in c++?

677


What is a class template in c++?

630


What is null c++?

692


What is std :: flush?

679


Write about the stack unwinding?

733






How can virtual functions in c++ be implemented?

698


What is an accessor in c++?

704


What is the rule of three?

660


Why do we use templates?

698


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2156


What are references in c++? What is a local reference?

670


What are the characteristics of friend functions?

650


What is a sequence in c++?

662


Comment on assignment operator in c++.

810


What is a class template?

695