//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 inheritance and how many types of inheritance?
Write a program to demonstrate the use of 'Composition' in C++
What are the 3 principles of oop?
function overridind means and simple program
What are the two different types of polymorphism?
What is the purpose of polymorphism?
what is polymorphism?
1. Define a class.
Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed?
Explain the concept of abstracion and encapsulation with one example. What is the difference between them?
Describe the difference between a Thread and a Process?
WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.