I have been looking through some MFC code and i came across this expression. It was in OnInitDialog() function, didn\'t look like it\'s MFC specific. The variables had some
Does this make any sense in C++?
Yes syntactically it does, but without comments you may not know the developers intentions were (if any) other than maybe suppressing a variable warning.
Is a variable name also an expression?
Yes a variable itself is an expression. Ex. if(
This code does compile, so how does this work?
It works by using the comma operator and ignoring the result of something then assigning 0 to somethingElse. Although something was marked volatile the original developer may of had a compiler that still complained about unused variables and being the clever developer he or she was then decided to suppress with that syntax.