C语言中do_while(0)使用

#include "main.h"

static int check_param(void)
{
    int ret = -1;
    do
    {
      if(1)
      {
          break;
      }
      ret = 0;
    }while(0);

    return ret;
}

int main()
{
    printf("param is %d\n",check_param());
    getchar();
    return 0;
}

  

posted @ 2020-09-15 21:39  卷哭你  阅读(274)  评论(0编辑  收藏  举报