我是一名java程序员,是C++的新手.在下面的代码中,我知道if(condition1)是否为true,返回variable1.但是有没有任何机制可以在第一个if条件求值为true之后处理第二个if?我问这个是因为我看过这样的代码,我在调试时发现了它.
if( condition1 )
{
return variable1;
}
//do some processing here
if( condition2 )
{
return variable2;
}
Run Code Online (Sandbox Code Playgroud) c++ ×1