Select the correct option to test your answer:
Computer
Plus Plus Miscellaneous
Difficulty: Medium
What will be the output of the following C++ code? #include <iostream> using namespace std; template<typename T>class clsTemplate { public: T value; clsTemplate(T i) { this->value = i; } void test() { cout << value << endl; } }; class clsChild : public clsTemplate<char> { public: clsChild(): clsTemplate<char>( 0 ) { } clsChild(char c): clsTemplate<char>( c ) { } void test2() { test(); } }; int main() { clsTemplate <int> a( 42 ); clsChild b( 'A' ); a.test(); b.test(); return 0; }
More Computer Questions
What will be the output of the following C code? #include <stdio.h> typedef struct student { char *a; }stu; void main() { struct stu s; s.a = "hi"; printf("%s", s.a); }
Which among the following is an optional Keyword?
In ASP.NET MVC, what is the purpose of the TempData object?
What will be the output of the following C# code? static void Main(string[] args) { int i; int b = 8, a = 32; for (i = 0; i <= 10; i++) { if ((a / b * 2)== 2) { Console.WriteLine( i + " "); continue; } else if (i != 4) Console.Write(i + " "); else break; } Console.ReadLine(); }
Which of these data member of HttpResponse class is used to store the response from an http server?