template<typename T, std::size_t S>
std::size_t SizeOf(T(&)[S]) {
return S;
}
int main()
{
double d[10];
cout << "d size is " << SizeOf(d) << endl;
char ch;
cin.getline(&ch, 1);
return 0;
}
No comments:
Post a Comment