What is the output of the following C program?
[gamipress_button type=”submit” label=”Run Code Online” onclick=”window.open(‘https://coderseditor.com’,’_blank’)”]
template <class S, class T> class Pair { private: S x; T y; /* ... */ }; template <class S> class Element { private: S x; /* ... */ }; int main () { Pair <Element<int>, Element<char>> p; return 0; }
Studently Answered question October 10, 2022
Output:
Compiler Error: ‘>>’ should be ‘> >’ within a nested template argument list
If there isn’t a space between two closing angular brackets, the operator >> will conflict when we use nested templates in our programme. For instance, the programme below successfully compiles.
Studently Answered question October 10, 2022