← Back to Question List
C++ Quiz #130
decltype(x) Versus decltype((x))
a is declared with decltype(x) and b with decltype((x)), the same variable with an extra pair of brackets. What is printed?
📄 Code
1#include <iostream>23int main() {4 int x = 5;5 decltype(x) a = x;6 decltype((x)) b = x;7 a = 10;8 b = 20;9 std::cout << x << " " << a << " " << b << "\n";10 return 0;11}