C --goto跳转语句

#include <iostream>
using namespace std;

void func(bool b) {
    if (b==true){
        goto label;
    }
    else {
        goto label1;
    }
label:
    cout << "" << endl;
    return;
label1:
    cout << "" << endl;
    return;
}

int main()
{
    /*
    goto语句:可以让CPU跳转到任何一条语句去执行
    语法:goto 标签
    */
    func(1);
    return 0;
}

 

 

 

C --goto跳转语句

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-07-27
  • 2022-03-10
猜你喜欢
  • 2021-06-11
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-09-03
相关资源
相似解决方案