//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 |
Can java compiler skips any statement during compilation time?
what is the realstic modeling?
Why do pointers exist?
What is a friend function & its advantage?
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
what is overloading
How do you use inheritance in unity?
How do you define social class?
Out of 4 concepts, which 3 C++ Follow?
What is encapsulation in oop?
What is difference between class and object with example?