//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 are the 3 principles of oop?
Is oop better than procedural?
What is inheritance write a program to show use of inheritance?
what is use to destroy an object? illustrate.
What is the real life example of polymorphism?
3. Differentiate verification and validation.
When not to use object oriented programming?
Write a program to multiply 3x3 matrics
Explain the advantages of inheritance.
What is oops in simple words?
What type of loop is a for loop?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?