πŸ“Š CPP Programming
Q. Which of the following is true about templates?
1) Template is a feature of C++ that allows us to write one code for different data types.
2) We can write one function that can be used for all data types including user defined types. Like sort(), max(), min(), ..etc.
3) We can write one class or struct that can be used for all data types including user defined types. Like Linked List, Stack, Queue,..etc.
4) Template is an example of compile time polymorphism.
  • (A) 1 and 2
  • (B) 1, 2 and 3
  • (C) 1, 2 and 4
  • (D) 1, 2, 3 and 4
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1, 2, 3 and 4

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
948
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
92%
Success Rate