← 返回列表

C库函数 strerror()

C库函数 strerror() #include <stdio.h> #include <string.h> #include <errno.h> int main () { FILE *fp; fp = fopen("file.txt","r"); if( fp == NULL ) { printf("Error: %s\n", strerror(errno)); } return(0); }

C库函数 strerror()

#include <stdio.h>

#include <string.h>

#include <errno.h>



int main () {

   FILE *fp;



   fp = fopen("file.txt","r");

   if( fp == NULL ) {

      printf("Error: %s\n", strerror(errno));

   }



   return(0);

}

打开资源 ↗

交流与评论