home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / extras / abslink / test.c < prev   
Encoding:
C/C++ Source or Header  |  1996-12-24  |  488 b   |  29 lines

  1. #include <proto/dos.h>
  2. #include <proto/exec.h>
  3. #include <string.h>
  4.  
  5. int x = 5;
  6. int y;
  7.  
  8. void print(char *);
  9.  
  10. int __saveds main(void)
  11. {
  12.    print("Hello, World!\n");
  13.    if(x != 5) print("x != 5!\n");
  14.    else       print("x is ok\n");
  15.    if(y != 0) print("y != 0!\n");
  16.    else       print("y is ok\n");
  17.    return(x);
  18. }
  19.  
  20. void print(char *string)
  21. {
  22.    struct Library *DOSBase;
  23.  
  24.    DOSBase=OpenLibrary("dos.library", 0L);
  25.    Write(Output(), string, strlen(string));
  26.    CloseLibrary(DOSBase);
  27. }
  28.  
  29.