//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 / 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 |
what is multithreading in c++ , what is difference between multithreading and singlethreading.
what do you mean by static member variable?
what is the need of abstraction? what is abstraction?what is the abstraction for stack?
What is class and object with example?
What is encapsulation?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
Which keyword is written to use a variable declared in one class in the other class?
What is overloading and its types?
why function overloading is not called as pure polymorphism?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What are the benefits of oop?
Example for 4 pillar of oops like, Inheritance,Poly,Abstraction,Encabsulation ?