LakshyaEducation.in

VEDIC MATHS Video Series
  • Home
  • Video Series
    • Vedic Maths Videos
    • Quantitative Aptitude Videos
    • Class 8 Maths Videos
    • Class 9 Maths Videos
    • Class 10 Maths Videos
  • Quiz & Solutions
  • Blog
  • Store
  • Login
  • Contact Us
  • Home
  • Topic
  • C++ Programming
  • Simple String Template

C++ Programming

SIMPLE STRING TEMPLATE MCQs

Total Questions : 5

Question 1.

How many parameters are legal for non-type template?


  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option D. -> 4

The following are legal for non-type template parameters: integral or enumeration type, Pointer 

to object or pointer to function, Reference to object or reference to function, Pointer to member.

Question 2.

What may be the name of the parameter that the template should take?


  1.    same as template
  2.    same as class
  3.    same as function
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> same as template

None

Question 3.

Which are done by compiler for templates?


  1.    type-safe
  2.    portability
  3.    code elimination
  4.    all of the mentioned
 Discuss Question
Answer is Option A. -> type-safe

The compiler can determine at compile time whether the type associated with a template definition 

can perform all of the functions required by that template definition.

Question 4.

How many types of templates are there in c++?


  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option B. -> 2

There are two types of templates. They are function template and class template.

Question 5.


What is the output of this program?



1.
#include
2.
#include
3.
using namespace std;
4.
template
5.
void print_mydata(T output)
6.
{
7.
cout
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option B. -> 2

Answer:a
Explanation:
In this program, We are passing the value to the template and printing it in the template.
Output:
$ g++ tem2.cpp
$ a.out
5.5
Hello World

  • Share on Facebook!
  • Share on Pinterest!

Sub Topics

  • Abstract Classes
  • Access Control
  • Argument Passing
  • Arrays
  • Booleans
  • C++ Concepts
  • Catching Exceptions
  • Character Types
  • Class Hierarchies And Abstract Classes
  • Class Hierarchies Introduction
  • Classes
  • Comments And Indentation
  • Complex Number Type
  • Constants
  • Constructors And Destructors
  • Container Design
  • Conversion Operators
  • Declaration
  • Default Arguments
  • Dereferencing
  • Derivation And Templates
  • Derived Classes
  • Design Of Class Hierarchies
  • Enumerations
  • Error Handling
  • Error Handling Alternatives
  • Essential Operators
  • Exception Specifications
  • Exceptions
  • Exceptions And Efficiency
  • Exceptions That Are Not Errors
  • Floating Point Types
  • Free Store
  • Friends
  • Function Call
  • Function Declarations
  • Function Templates
  • Functions
  • Grouping Of Exceptions
  • Header Files Usage
  • Increment And Decrement
  • Integer Types
  • Large Objects
  • Linkage
  • Macros
  • Modularization And Interfaces
  • Multiple Inheritance
  • Namespaces
  • Objects
  • Objects And Classes
  • Oops Concepts
  • Operator Functions
  • Operators
  • Overloaded Function Names
  • Pointer To Function
  • Pointer To Void
  • Pointers
  • Pointers Into Arrays
  • Pointers To Members
  • References
  • Resource Management
  • Run Time Type Information
  • Sequence Adapters
  • Sequences
  • Simple String Template
  • Sizes
  • Specialization
  • Standard Exceptions
  • Standard Library Design
  • Statements
  • String Class
  • Structures
  • Subscripting
  • Template Arguments To Specify Policy Usage
  • Types
  • Uncaught Exceptions
  • Unspecified Number Of Arguments
  • User Defined Types
  • Value Return
  • Vector
  • Void

Topics

  • Computer Aptitude
  • SAIL Junior Officer (E-0)
  • 10th Grade
  • 11th Grade
  • 12th Grade
  • 4th Grade
  • 5th Grade
  • 6th Grade
  • 7th Grade
  • 8th Grade
  • 9th Grade
  • NCERT
  • Cat
  • Commerce
  • Computer Science
  • Engineering
  • English
  • General Knowledge
  • Ias
  • Management
  • Quantitative Aptitude
  • Reasoning Aptitude
  • General Studies (Finance And Economics)
  • Analytical Instrumentation
  • Biochemistry
  • Bioinformatics
  • Biology
  • Biotechnology
  • Bitsat
  • Business Statistics
  • C Programming
  • C++ Programming
  • Cell Biology
  • Chemistry
  • Cost Accounting
  • Drug And Pharmaceutical Biotechnology
  • Electrical Measurement And Instrumentation
  • Environment Management
  • Environmental Biotechnology
  • Enzyme Technology
  • Financial Management And Financial Markets
  • Gate
  • General Science
  • Geography
  • Heat Transfer
  • History And National Movements
  • Human Anatomy And Physiology
  • Human And Cultural Diversity
  • Human Resource Management
  • Indian Economy
  • Indian Geography
  • Indian History
  • Indian Polity
  • Instrumentation Transducers
  • International Relations
  • Life Sciences
  • Marketing And Marketing Management
  • Mass Transfer
  • Mechanics Of Materials
  • Microbiology
  • Neet
  • Professional Communication
  • Renewable Energy
  • Sociology
  • Surveying
  • Total Quality Management
  • Uidai Aadhaar Supervisor Certification
  • Virology

Recent Questions

Q.    _________ Is The Connective Tissue Beneath the Sk....

Q.   Positive Integers Indicated By X And Y Satisfy 3 1/x * Y 2/....

Q.   The Knocking Tendency In Compression Ignition Engines For A ....

Q.   In __________verb The Action Passes From The Subject An Obje....

Q.   Pre-cooling Is Required Before Passing The Vapour To The Con....

Q.   Ctrl + I Is Used To

Q.   Q. Consider The Following Items: Prison Trade And Co....

Q.   Who Is Paul A. Volcker ?

Q.   If H₁ = Inner Film Co-efficient And /h₂ = Outer Film Co-....

Q.   Which One Is True About Bacteria

Q.   Who Was The 1st President Of BCCI ( Board Of Control For Cri....

Q.   A Combinational Logic Circuit Which Generates Particular Bin....

Q.   Assertion A : To Estimate The Rainfall Over A Catchment, The....

Q.   A....

Q.   The Department Of Atomic Energy Was Established In

Q.   In Figure, The Current I

Q.   A Bar Of Square Section Of Area A² Is Held Such That It....

Q.   Vane Anemometer

Q.   When Low Carbon Steel Is Heated Up To Upper Critical Tempera....

Q.   Metacentric Height Is Given As The Distance Between

LakshyaEducation.in
Lakshya Education
Bhilai,Chattisgarh,India
Email: admin@lakshyaeducation.in Phone: 07893519977 (WhatsApp)

Quick Links

  • Vedic Maths
  • Quantitative Aptitude
  • Class – IX Maths
  • Class – X Maths
  • YouTube Channel
  • Maths Fast Trick
  • Blog

Our Services

  • About us
  • Privacy
  • TOS
  • Refund / Cancellation
  • Contact
  • Affiliate Program
  • Copyright © 2022 All Right Reserved | Lakshya Education     ( )
    Login / Register

    Your Account will be created automatically when you click the below Google or Facebook Login Button.
    •   Login With Facebook
    •  Login With Google
     Login With Email/Password