I have read in a lot of places but I really can't understand the specified behavior in conditionals.
I understand that in assignments it evaluates the first operand, discards the result, then evaluates the second operand.
But for this code, what it supposed to do?
CPartFile* partfile = (CPartFile*)lParam;
ASSERT( partfile != NULL );
bool bDeleted = false;
if (partfile,bDeleted)
partfile->PerformFileCompleteEnd(wParam);
The partfile in the IF was an unnecessary argument, or it have any meaning?
Punctuating Conditional SentencesUse a comma after the if-clause when the if-clause precedes the main clause. If I'd had time, I would have cleaned the house. If the main clause precedes the if-clause, no punctuation is necessary.
The Comma as an Operator We use the comma in the form of an operator when we want to assign multiple numbers of values to any variable in a program with the help of a comma.
In the C and C++ programming languages, the comma operator (represented by the token , ) is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type); there is a sequence point between these evaluations.
There are three conditional operators: && the logical AND operator. || the logical OR operator. ?: the ternary operator.
In this case, it is an unnecessary expression, and can be deleted without changing the meaning of the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With