errno和%m

#include<stdio.h>

//#include<string.h>

//#include<errno.h>

int main()

{

   FILE* file = fopen("/etc/passwd","w");

   if(file==NULL){

       //printf("error in open file:errno=%d\n",errno);

       //printf("%s\n",strerror(errno));//根據錯誤碼,得到錯誤信息字符串

       //perror("ERROR");

       printf("%m\n");

   }

   return 0;

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章