//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
What is the real time example of encapsulation?
Get me a number puzzle game-program
How does polymorphism work?
class type to basic type conversion
Why it is called runtime polymorphism?
What is polymorphism used for?
What is abstraction oop?
What are properties in oop?
What is inheritance and how many types of inheritance?
Why multiple inheritance is not possible?
what is difference between class template and template class?
What language is oop?
what are the ways in which a constructors can be called?
Why is oop useful?
How do you answer polymorphism?