1.

Which among the following is the proper syntax for the template class?(a) template ;(b) Template ;(c) template T named(T x, T y){  }(d) Template T1 named(T1 x, T2 y){  }

Answer» Correct option is (c) template T named(T x, T y){  }

Easiest explanation - The syntax must start with keyword template, case sensitive. Then it should include the typename and a variable to denote it. Then whenever that variable is used, it replaces it with the data type needed.


Discussion

No Comment Found

Related InterviewSolutions