Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#include <iostream>
#include <cassert>
#include <cstdlib>
int multiply(int x, int y) {
return x * y;
}
void type_safe_print() {
std::cout << std::endl;
}
template<class T, class ...Args>
void type_safe_print(T val, Args...args) {
std::cout << val;
type_safe_print(args...);
}
int main(int argc, char **argv) {
assert(argc == 3);
int a = atoi(argv[1]);
int b = atoi(argv[2]);
type_safe_print(a, " x ", b, " = ", multiply(a,b));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment