Why do we need templates?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ General Interview Questions

class Alpha { public: char data[10000]; Alpha(); ~Alpha(); }; class Beta { public: Beta() { n = 0; } void FillData(Alpha a); private: int n; }; How do you make the above sample code more efficient? a) If possible, make the constructor for Beta private to reduce the overhead of public constructors. b) Change the return type in FillData to int to negate the implicit return conversion from "int" to "void". c) Make the destructor for Alpha virtual. d) Make the constructor for Alpha virtual. e) Pass a const reference to Alpha in FillData

2 Answers   Quark,


Is c++ the hardest language?

0 Answers  


What is the maximum combined length of command line arguments including the space between adjacent arguments?

0 Answers  


What parameter does the constructor to an ofstream object take?

0 Answers  


How many characters are recognized by ANSI C++?

0 Answers   Hexaware, NIIT,






What is the latest version on c++?

0 Answers  


What is the v-ptr?

0 Answers  


What are the total number of lines written by you in C/C++? What is the most complicated or valuable program written in C/C++?

2 Answers   Intel,


What is class syntax c++?

0 Answers  


What is std namespace in c++?

0 Answers  


What is scope resolution operator in c++ with example?

0 Answers  


How to implement is-a and has-a class relationships?

0 Answers  


Categories