CPP practice question 10 of 30

What will happen when you attempt to compile and run the following code? #include #include using namespace std; template class A { T_v; public: A() {} A(T v): _v(v){} T getV() { return _v; } void add(T & a) { _v+=a; } }; int main() { Aa("Hello"); string s(" world!"); a.add(s); cout

Full set: 228 questions
Answer options
A: program will display: Hello world! Correct answer
B: program will not compile
C: program will display: Hello
D: program will run without any output
Correct Answer:
A. program will display: Hello world!
Scroll to Top