//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


Please Help Members By Posting Answers For Below Questions

What are properties in oop?

617


Which is better struts or spring?

629


What is meant by multiple inheritance?

744


Why do we need oop?

679


What is basic concept of oop?

714






Is abstract thinking intelligence?

605


What is constructor overloading in oop?

618


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1660


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(); }

1998


What is overriding vs overloading?

590


what is different between oops and c++

2010


What is the diamond problem in inheritance?

594


Get me an image implementation program.

1569


What is oops concept with example?

587


What is this pointer in oop?

565