I wrote an examination about C++ programming. There was one question where I and my professor didn't agree. The question was, does the following function work or not:
#include <iostream>
using namespace std;
void f(int=4, long=10, double=3.14);
int main( int argc , char ** argv )
{
f( , ,8);
return EXIT_SUCCESS;
}
void f(int i, long l, double d) {
cout << i << " " << " " << l << " " << d;
}
I said it would not work, but my professor said it will definitely work because of the default parameter in the function declaration. I tried it with MSVC and it didn't work. Is that compiler-specific? How can I convince my professor it doesn't work in any compiler, to raise my mark in the examination?