Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iterator>
- #include <array>
- template <class T>
- void print_array(T start, T end) {
- for (T t = start; t < end; t++)
- std::cout << std::hex << std::uppercase << *t << std::flush;
- std::cout.put('\n').flush();
- }
- int main(int argc, const char * argv[]) {
- std::array<int, 6> array = {10, 11, 12, 13, 14, 15};
- print_array(array.begin(), array.end());
- print_array(array.rbegin(), array.rend());
- std::cout << "Press ENTER to continue..." << std::flush;
- std::cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement