fork(1) download
  1. #include <iostream>
  2.  
  3. template < std::size_t NUM_ELEMENTS > void mergeSort( int (&A)[NUM_ELEMENTS] )
  4. {
  5. //* here I want to find number of elements in the array A
  6. std::cout << "number of elements in the array A is: " << NUM_ELEMENTS << '\n' ;
  7.  
  8. // ...
  9.  
  10. }
  11.  
  12. int main()
  13. {
  14. int A[]={10,5,3,37,13,9,24,7,39,19};
  15. mergeSort(A);
  16. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
number of elements in the array A is: 10