//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
Why is static class not inherited?
What causes polymorphism?
Can enum be null?
What is a null tree?
What is the renewal class?
What is methods in oop?
What is object in oop?
class type to basic type conversion
What is polymorphism and example?
What is property in oops?
Can we override main method?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
Why is oop better than procedural?
What is the main feature of oop?
Can destructor be overloaded?