//what is wrong with the programme??
#include<iostream.h>
template <class first>
class dd
{
first i;
public:
void set();
void print();
};
void dd< first>:: set()
{
cin>>i;
}
void dd< first>::print()
{
cout<<"\n"<<i;
}
void main()
{
dd <char>g;
g.set();
g.print();
}
Answer Posted / prakash
template<class first> void dd<first>::set()
{
cin>>i;
}
template<class first> void dd<first>::print()
{
cout<<"\n"<<i;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What are the 4 main oop principles?
What is the real time example of encapsulation?
What is pointer in oop?
What is the significance of classes in oop?
What is the purpose of enum?
• What are the desirable attributes for memory managment?
Is react oop?
What is the difference between procedural programming and oops?
Why is polymorphism needed?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What is polymorphism programming?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is a class in oop?
What is oops concept with example?