The following code is very basic and obvious:
void PrintParameter(int i, char c)
{
std::cout << i << std::endl;
}
If I do this:
PrintParameter(5, 'A');
I get 5 as expected and because I don't use the parameter c
no error occurs.
Now I think in a weird thing I expect as being an error:
void PrintParameter(int i, char) // declare the type 'char' without the variable
{
std::cout << i << std::endl;
}
I expected an error because of the absence of the variable of type char.
However, instead of an error, I get 5 as before!
This is a bug of my compiler or a compliance with ISO C++ standard?
In case of not being an error this applies only to C++ or to C also?