Possible Duplicate:
What does this line of code mean?
I was reading an article on Opencv, and came across this:
for( i = 0; i < (faces ? faces->total : 0); i++ )
{
CvRect* r = (CvRect*)cvGetSeqElem(faces, i);
}
What in the world is this line supposed to mean:
i < (faces ? faces->total : 0)
It’s the conditional operator.
The
(faces ? faces->total : 0)testsfaces. If it’s true, thenfaces->totalis returned and compared withi. Otherwise, if it evaluates to false,iis compared to0.