Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- template<int N>
- struct Factorial {
- enum {
- value = Factorial<N-1>::value * N
- };
- };
- template<>
- struct Factorial<0> {
- enum { value = 1 };
- };//*/
- int main()
- {
- int i = Factorial<4>::value;
- cout << i << endl;
- char c[Factorial<4>::value];
- cout << sizeof(c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement