Last active
September 17, 2015 04:44
-
-
Save keisukefukuda/0669a7326ee7aab2aa00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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