//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();
}



//what is wrong with the programme?? #include<iostream.h> template <class first> clas..

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

Post New Answer

More OOPS Interview Questions

What is inheritance and how many types of inheritance?

0 Answers  


Write a program to demonstrate the use of 'Composition' in C++

2 Answers  


What are the 3 principles of oop?

0 Answers  


function overridind means and simple program

2 Answers  


What are the two different types of polymorphism?

0 Answers  






What is the purpose of polymorphism?

0 Answers  


what is polymorphism?

4 Answers  


1. Define a class.

6 Answers  


Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed?

4 Answers   EA Electronic Arts,


Explain the concept of abstracion and encapsulation with one example. What is the difference between them?

3 Answers   PCS,


Describe the difference between a Thread and a Process?

11 Answers   Siebel Systems,


WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.

11 Answers  


Categories