42_CPP07/ex01/src/main.cpp
2023-09-21 13:03:30 +02:00

25 lines
339 B
C++

#include "iter.hpp"
#include <iostream>
template<typename T>
void print(T& t)
{
std::cout << t << std::endl;
}
int main()
{
int array[] = {0, 1, 2, 3, 4, 5, 6};
iter(array, 7, print<int>);
std::string strs[] = {
"Hello World",
"Bonjour Monde",
"Hallo Welt",
"Hola Mundo"
};
iter(strs, 4, print<std::string>);
}