Possible Duplicate:
What does “(void) new” mean in C++?
I’m not familiar with C++ and I don’t understand the line right after the method signature:
int EAN13Reader::decodeMiddle(Ref<BitArray> row,
int startGuardBegin,
int startGuardEnd,
std::string& resultString)
{
(void)startGuardBegin;
...
}
What’s (void)startGuardBegin;? A method invokation?
It tells the compiler that the argument is unused and thus it shouldn’t show an “unused argument” warning.
While compilers such as GCC usually have other ways (
int startGuardBegin __attribute__ ((unused))) to indicated this, usually somehow in the function header, casting it to(void)does not rely on any compiler-specific features.