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
How do pointers work?
How do you compile the source code with your compiler?
What is virtual destructor ans explain its use?
Can malloc be used in c++?
You want to link a c++ program to c functions. How would you do it?
How many static variables are created if you put one static member into a template class definition?
What is using namespace std in cpp?
How is c++ used in the real world?
Explain the difference between overloading and overriding?
Define linked lists with the help of an example.
What are the basic data types used in c++?
What do you mean by public protected and private in c++?
What is c++ library?
When does a 'this' pointer get created?
What is lambda expression c++?