Possible Duplicate:
Why cast an unused value to void?
for this C++ code:
MyClass::myFunc(int val)
{
//some code
(void)val;
//somecode
}
why may we need to cast val to void without being assigned to another variable ?
Possible Duplicate:
Why cast an unused value to void?
for this C++ code:
MyClass::myFunc(int val)
{
//some code
(void)val;
//somecode
}
why may we need to cast val to void without being assigned to another variable ?
This is done to shut up the compiler, warning about an unused variable.