fork download
  1. #include <stdio.h>
  2.  
  3. int arr[265];
  4. int* arr1=arr;
  5.  
  6. #define CONSTEXPR /*constexpr*/ /*since gcc 2.7.2*/
  7.  
  8. template<class T, size_t N>
  9. CONSTEXPR size_t LengthOfArray(T(&)[N])
  10. {
  11. return N;
  12. }
  13.  
  14. int main(void) {
  15. arr1[5]=5;
  16. printf("%zu", LengthOfArray(arr1));
  17. return 0;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16: error: no matching function for call to ‘LengthOfArray(int*&)’
stdout
Standard output is empty