template <typename T, int n >
int tell_me_size(T (&) [n]){
return n;
}
this code works fine with
int a[4];
cout<< tell_me_size(a)<<endl;
while does not work with
int n;
cin>>n;
int a[n];
cout<< tell_me_size(a)<<endl;
The later gives the error "no matching function for call to ‘tell_me_size(int [n])"