您的位置:首页 > 其它

strerror

2016-06-16 10:11 274 查看
#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 contents
cout << sz << endl;	//<================= Put a breakpoint here

char * 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!
2
No such file or directory
2
No such file or directory
*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: