⟩ Can you please explain what is class using C++?
A class holds the data and functions that operate on the data. It serves as the template of an object.
A class holds the data and functions that operate on the data. It serves as the template of an object.
Tell me what are the basic Concepts used in the Object-Oriented Programming language?
What is Encapsulation in C++?
What is Template class?
What is Polymorphism in C++?
What is Inheritance in C++?
What is the validity of template parameters? a) inside that block only b) inside the class c) whole program d) any of the mentioned
Which of the things does not require instantiation? a) functions b) non virtual member function c) member class d) all of the mentioned
Which keyword can be used in template? a) class b) typename c) both a & b d) function
What is the output of this program? #include <iostream> using namespace std; template <class T, int N> class mysequence { T memblock [N]; public void setmember (int x, T value); T getmember (int x); }; template <class T, int N> void mysequence<T,N> setmember (int x, T value) { memblock[x] = value; } template <class T, int N> T mysequence<T,N> getmember (int x) { return memblock[x]; } int main () { mysequence <int, 5> myints; mysequence <double, 5> myfloats; myints.setmember (0, 100); myfloats.setmember (3, 3.1416); cout << myints.getmember(0) << 'n'; cout << myfloats.getmember(3) << 'n'; return 0; } a) 100 b) 3.1416 c) 100 3.1416 d) none of the mentioned
What is the output of this program? #include <iostream> using namespace std; template <class T> T max (T a, T b) { return (a>b?ab); } int main () { int i = 5, j = 6, k; long l = 10, m = 5, n; k = max(i, j); n = max(l, m); cout << k << endl; cout << n << endl; return 0; } a) 6 b) 6 10 c) 5 10 d) 6 5