LogiQuest
Back to Templates
2

What will be the output of the program?

#include <iostream>
using namespace std;
template <typename T, int N>
int size(T (&)[N]) { return N; }
int main() {
    int a[7];
    cout << size(a) << endl;
    return 0;
}
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.