Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which statement(s) does not invoke the above template correctly? - Select option

  Shared By: Lucas Silva    Date: Jul 18    Category: C++ Programming    Views: 804

Answer:

Consider the declaration of a template non-type argument in the following code snippet:
template <class temp, int max> class sample
{
temp a[max];
static int b=50;
// ………
}

Which of the following statement(s) does not invoke the above template correctly?

I. sample<float, 10*10> x;
II. sample<float, 30>20> x;
III. sample<float, (30>20)> x;
IV. sample<float, 10.0> x;

Options

a) I only
b) III only
c) Both II and IV
d) Both I and III

Answer : c) Both II and IV

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: