strerror

来源:互联网 发布:网络机顶盒怎么用wifi 编辑:程序博客网 时间:2024/05/22 13:51
#include <iostream>#include <stdio.h>#include <time.h>#include <string.h>#include <errno.h>using namespace std;int main(int argc, char *argv []){char sz [] = "Hello, World!";//Hover mouse over "sz" while debugging to see its contentscout << sz << endl;//<================= Put a breakpoint herechar * mesg = strerror(ENOENT);printf("%d\n", ENOENT);printf("%s\n", mesg);if (remove("/home/test") == 0){printf("ok\n");}else{char * mesg = strerror(errno);printf("%d\n", errno);printf("%s\n", mesg);}return 0;}/*Hello, World!2No such file or directory2No such file or directory*/

0 0