c++ general int array and vector iterator -


in following code, need define iterator can iterate on both vector<int> , int[100]. how define mi here?

template<class arraytype> void array_show(arraytype array, size_t arraysize) {     // how define mi????     (mi = array; array != m.end(); array++)         std::cout << " " << *mi << std::endl; } 

here example below. importantpart use arraytype& - reference, way regular array not decayed pointer - way possible read size inside array_show.

template<class arraytype> void array_show(arraytype& array, size_t arraysize) {     // how define mi????     (auto mi = std::begin(array); mi != std::end(array); mi++)         std::cout << " " << *mi << std::endl; } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -