//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 are properties in oop?
Which is better struts or spring?
What is meant by multiple inheritance?
Why do we need oop?
What is basic concept of oop?
Is abstract thinking intelligence?
What is constructor overloading in oop?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
What is overriding vs overloading?
what is different between oops and c++
What is the diamond problem in inheritance?
Get me an image implementation program.
What is oops concept with example?
What is this pointer in oop?