J
jose luis fernandez diaz
Hi,
In the program below:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
using namespace std;
int main()
{
system("ls asdf");
printf("%d\n", errno);
return 0;
}
the output is:
ls: asdf not found
0
Two questions:
1) How can I get the error message(ls: asdf not found) in the program?
2) Why is errno 0 ?
Thanks,
Jose Luis.
In the program below:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
using namespace std;
int main()
{
system("ls asdf");
printf("%d\n", errno);
return 0;
}
the output is:
ls: asdf not found
0
Two questions:
1) How can I get the error message(ls: asdf not found) in the program?
2) Why is errno 0 ?
Thanks,
Jose Luis.