函数perror、strerror

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/isunbin/article/details/83350342

perror函数

函数原型: 

#include<stdio.h>
void perror(const char *msg);

测试代码:

#include<unistd.h>
#include<errno.h>
#include<stdio.h>

int main()
{
    int ret;
    ret = close(10);
    if(ret == -1) {
        perror("close error");
    }

    return 0;
}

猜你喜欢

转载自blog.csdn.net/isunbin/article/details/83350342
今日推荐