1.

Output of following program? Assume that the size of char is 1 byte and size of int is 4 bytes, and there is no alignment done by the compiler.#include<iostream>#include<stdlib.h>using namespace std;template<class T, class U>class A {T x;U y;static int count;};int main() {A<char, char> a;A<int, int> b;cout << sizeof(a) << endl;cout << sizeof(b) << endl;return 0;}(A)612(B)28(C) Compiler Error: There can not be more than one template arguments.(D)88

Answer»


Discussion

No Comment Found

Related InterviewSolutions