My Java instructor yesterday gave us a sample test. One line that surprised me was something like
if ( m2++ < 10 ) { ………
iow the first thing done is , in effect m2 = m2 + 1, an ASSIGNMENT.
Whether the instructor ever actually discussed this in the first place
cannot be answered on this site. But other relevant questions can.
First, my ignorance. While I am obviously not an expert ,
neither am I exactly a neophyte virgin. But I must admit
this idea of an assignment statement INSIDE an if statement boolean expression
( as opposed to AFTER the then/else portion ) is a big newsflash to me.
Two questions follow :
1) how common in other languages is this concept nowadays ?
2) On a scale from zero meaning complete ignorance to 10
meaning world’s greatest expert,
how does my complete ignorance of the concept actually rate ?
A third question is more subjective :
could you describe a situation where this facility would be useful or indeed advisable ?
Thanks.