Live Help (Start Chat)
View Count: 0
Duration: 30 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 30 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 30 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 14
Which symbol is used to define a variable of template data type? 
Options:
  1. ()
  2. {}
  3. <>
  4. []
View Answer/Explanation:
c
Explanation:
Angular braces <> is responsible for defining a variable of template type which can be used inside the program to manipulate variables of different type.

Question No: 2 of 14
Which symbol is used to separate the number of template variables? 
Options:
  1. ;
  2. ,
  3. :
  4. ::
View Answer/Explanation:
b
Explanation:

Question No: 3 of 14
A generic programming approach is one which can process only the defined data type. 
Options:
  1. True
  2. False
View Answer/Explanation:
b
Explanation:
A generic programming approach is one which can process all the C++ data types.

Question No: 4 of 14
Can we define templates for both classes and functions? 
Options:
  1. Yes
  2. No
  3. Only classes
  4. Only functions
View Answer/Explanation:
a
Explanation:

Question No: 5 of 14
The process of creating a specific class from a class template is called as ………………. 
Options:
  1. Template class
  2. Generic class
  3. Instantiation
  4. None of the above
View Answer/Explanation:
c
Explanation:

Question No: 6 of 14
Templates enable us to define ……………….. classes 
Options:
  1. Base class
  2. Generic class
  3. Derived class
  4. None of the above
View Answer/Explanation:
b
Explanation:
Templates enable us to define generic classes.

Question No: 7 of 14
When will the compiler perform error analysis? 
Options:
  1. Only when the template class is created
  2. Only when the Instantiation has completed his job
  3. Only when the template class has declared
  4. Only when an Instantiation takes place
View Answer/Explanation:
d
Explanation:

Question No: 8 of 14
What does the Template instructs the compiler? 
Options:
  1. That the class is using a data type
  2. That the class is using a non data type
  3. That the class is using a Template data type
  4. Both (a) & (c)
View Answer/Explanation:
c
Explanation:
Template instructs the compiler that the class is using a template data type.

Question No: 9 of 14
What is the output of the following program?
#include 
using namespace std;
template
class Number
{
public:
Number(T a)
{
  cout< 
Options:
  1. 2
  2. Syntax error
  3. Compile error
  4. Runtime error
  5. Both (b) & (c)
View Answer/Explanation:
e
Explanation:
Here in this statement Number N1(2), we are creating the object of the class and at the same time we are passing the value but at the time of passing the value we must also mention the data type of the value passed in the parameter and here we did not mention the data type of the value passed. So it is an syntax error which occurred at compile time.

Question No: 10 of 14
A Template function is overloaded either by a template function or by an ordinary function of its name. 
Options:
  1. True
  2. False
View Answer/Explanation:
a
Explanation:

  1