//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 overloading in oop?
What is the main purpose of inheritance law?
What is the highest level of cohesion?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
When not to use object oriented programming?
What is encapsulation process?
Why is oop useful?
Can we override main method?
Why do we use polymorphism?
What are the 3 principles of oop?
What is variable example?
What is protected in oop?
to find out the minimum of two integer number of two different classes using friend function
what is difference between class template and template class?
What is encapsulation in oops?