Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


//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

Can java compiler skips any statement during compilation time?

0 Answers  


what is the realstic modeling?

1 Answers  


Why do pointers exist?

0 Answers  


What is a friend function & its advantage?

1 Answers   MIT,


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?.

2 Answers  


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

1 Answers   HCL, TCS,


what is overloading

3 Answers   MindCracker,


How do you use inheritance in unity?

0 Answers  


How do you define social class?

0 Answers  


Out of 4 concepts, which 3 C++ Follow?

1 Answers   TCS,


What is encapsulation in oop?

0 Answers  


What is difference between class and object with example?

1 Answers  


Categories