executeThisFunctionInAnyCase
全部标签 假设我有这个伪代码:boolconditionA=executeStepA();if(conditionA){boolconditionB=executeStepB();if(conditionB){boolconditionC=executeStepC();if(conditionC){...}}}executeThisFunctionInAnyCase();函数executeStepX当且仅当前一个成功时才应该执行。在任何情况下,都应该在最后调用executeThisFunctionInAnyCase函数。我是编程新手,很抱歉这个非常基本的问题:有没有办法(例如在C/C++中)避免
假设我有这个伪代码:boolconditionA=executeStepA();if(conditionA){boolconditionB=executeStepB();if(conditionB){boolconditionC=executeStepC();if(conditionC){...}}}executeThisFunctionInAnyCase();函数executeStepX当且仅当前一个成功时才应该执行。在任何情况下,都应该在最后调用executeThisFunctionInAnyCase函数。我是编程新手,很抱歉这个非常基本的问题:有没有办法(例如在C/C++中)避免