C++ | Templates | Question 6
Output of following program? Assume that the size of int is 4 bytes and size of double is 8 bytes, and there is no alignment done by the compiler.
(a) << endl;
(b) << endl;
(D) Compiler Error: template parameters cannot have default values.
Explanation: templates can also have default parameters. The rule is same all default values must be on the rightmost side.
Since count is static, it is not counted in sizeof.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.