zoukankan      html  css  js  c++  java
  • UNIX环境高级编程1.7出错处理

    VR~0[X45RDKU57VE$JVUVQ6

    CDN[U2SG]1_23H%}1QW{`LV

    9E04)Y1SF{TWW}F~TC304D4

     
    // program 1-7 file/testerror.c
    #include "apue.h"
    #include <errno.h>
    
    int main(int argc, char *argv[])
    {
        fprintf(stderr, "EACCES: %s
    ", strerror(EACCES));
        errno = ENOENT;
        perror(argv[0]);
        exit(0);
    }
    
     
    all: mycat hello testerror
    mycat: ls1.c
    	g++ -g -Wall ls1.c ../lib/libapue.a -I ../include -o ls1
    hello: hello.c
    	g++ -g -Wall hello.c -I ../include/ ../lib/libapue.a -o hello
    testerror: testerror.c
    	g++ -g -Wall testerror.c -I ../include/ ../lib/libapue.a -o testerror
    clean:
    	rm ls1 hello testerror

    `FU3_]UBZ}}DID`T62PU@Y4

    9556fa84bbefbd20d6f0d8fa87fceb26

  • 相关阅读:
    2.6
    zuoye
    练习1
    练习
    练习
    4
    3
    2
    1
    1.3
  • 原文地址:https://www.cnblogs.com/sunyongjie1984/p/4260720.html
Copyright © 2011-2022 走看看