我想知道是否有任何简单的方法可以直接“跳转”到特定案例。
我知道这可以通过使用 do while 循环来完成。想知道是否有更优雅的方式。
例如(当然不是整个代码):
.
.
.
case 8:
{
if (grades.findStudent(tempid1)==-1)
{
cout << "\nOne of the ID's you have entered wasn't found. Try again.\n" << endl;
case(8); //<- <- <- something like that
}
}
break;
.
.
.