//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 |
Why polymorphism is used in oops?
What is the real time example of encapsulation?
What is polymorphism what is it for and how is it used?
Which keyword is written to use a variable declared in one class in the other class?
In what situation factory design patterns,DAO design patterns,singleton design patterns should be applied.?
What is destructor example?
What is data binding?
What is difference between data abstraction and encapsulation?
Where is pseudocode used?
What is interface? When and where is it used?
Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?
Is oop better than procedural?