In Stroustrup\'s The C++ Programming Language: Special Edition (3rd Ed), Stroustrup writes that the declaration and initialization of variables in the conditionals
Adding to what RedGlyph and Ferruccio said. May be we can do the following to still declare within a conditional statement to limit its use:
if(int x = read(socket)) //x != 0 { if(x < 0) //handle error {} else //do work {} } else //x == 0 { return true; }