1.
#include<iostream>
2.

3.
#define _sizeoftype(T) ((int)(((T*)0)+1))
4.

5.
template <typename T, size_t N >
6.
size_t arrayLength(const T (&)[ N ],size_t sizeoftype ) {
7.
return sizeoftype*N;
8.
}
9.

10.
int main() {
11.
int array[7];
12.
std::cout<<"SizeOf Array :"<<arrayLength(array,_sizeoftype(int))<<std::endl ;
13.
return 0;
14.
}
15.