Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C++ Programming :: Templates

Home > C++ Programming > Templates > General Questions

1. Template support

Answer: generic programming

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

2. Which of the following can be passed to function template as an argument?

Answer: All of these

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

3. The desired type is added to a specific template class instantiation by placing the type's name

Answer: between angle brackets

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

4. Function template can be overloaded with

Answer: both (a) and (b)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

5. A class template can declare

Answer: static data members

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

6. The arguments of class template are of

Answer: all of these

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

7. What is the output of the below C++ program?

#include < iostream >
#include < string >
using namespace std;
template < typename T >
void print_mydata(T output)
{
cout << output << endl;
}
int main()
{
double d = 5.5;
string s("Hello World");
print_mydata( d );
print_mydata( s );
return 0;
}

Answer: 5.5

Explanation:

Passing the value to template and printig it in template.

Workspace

Tags:

No Tags on this question yet!

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

Answer: 2

Explanation:

function template
class template

Workspace

Tags:

No Tags on this question yet!

9. What is a template?

Answer: A template is a formula for creating a generic class

Explanation:

A template is a formula for creating a generic class

Workspace

Tags:

No Tags on this question yet!

10. What is meant by template parameter?

Answer: It can be used to pass a type as argument

Explanation:

A template parameter is a special kind of parameter that can be used to pass a type as argument.

Workspace

Tags:

No Tags on this question yet!