iT邦幫忙

0

c語言中exit的用法

  • 分享至 

  • xImage
  •  

紀錄一下遇到錯誤時直接exit的寫法

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) 
{
    if (argc != 2) {
        fprintf(stderr, "error: no input file");
        exit(EXIT_FAILURE); // 或exit(1);
    }

    exit(EXIT_SUCCESS); // 或exit(0);
}

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言