fork download
  1. #include <cstdio>
  2.  
  3. template<std::size_t N>
  4. int length(int (&ary)[N])
  5. {
  6. printf("%d %d %d\n", N * sizeof(int), sizeof(int), N);
  7. return N;
  8. }
  9.  
  10. int main () {
  11. int ary[] = {1,2,3,4,5,6};
  12. length(ary);
  13. printf("%d %d %d\n", sizeof(ary), sizeof(ary[0]), sizeof(ary)/sizeof(ary[0]));
  14. }
  15.  
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
24 4 6
24 4 6