C++ MQCs with Explanation ( WORKING WITH FILES)

Consider a function template as shown below: template < class T > int find (T*array, T n, int m) { for ( int i = o; i < m; i++) if (array [i] = = n return i; return (-1); } Which one of the following prototype calls can generate a function?

  1. find (int*, float, int);
  2. find (T*, int, int);
  3. find (int*, int, float);
  4. find (float*, float, int);



Answer: 
Option b: find (T*, int, int);

Explanation Here

Post a Comment

0 Comments