#include <iostream>
#include <cstdarg>
template < typename T >
void print( int numArgs, ... ) {
va_list vl;
va_start( vl, numArgs );
for ( int i = 0; i < numArgs; i++ ) {
T arg = va_arg( vl, T );
std::cout << arg;
}
}
int main( int argc, char* argv[] ) {
print( 2, "Hello, ", " World!" );
return 0;
}
When I compile it, I get the following error: error: no matching function for call to 'print(int, const char [8], const char [8])'
What is wrong with the code?