C++ MQCs with Explanation ( WORKING WITH FILES)

The following is a list of header lines for creating function templates. Which of them is legal?

  1. template < class T > swap ( T & x, T & y)
  2. template < T > void swap (T & x, T & y)
  3. class < template T> void swap (T & x, T & y)
  4. None of the above



Answer: 
Option b: template < T > void swap (T & x, T & y)

Explanation Here

Post a Comment

0 Comments