home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / c / helloworld.c < prev    next >
C/C++ Source or Header  |  1992-08-13  |  894b  |  39 lines

  1. /*******************************************************
  2.  
  3.         helloworld.c
  4.  
  5.    by Mika Kuulusa ( k114636@cc.tut.fi )
  6.  
  7. (an extremely small 'helloworld' program)
  8.  
  9. 'I made this just to show how EFFECTIVE C an be! ;-)   '
  10.  
  11.     ----------------------
  12.  
  13. Compiled with:        (SASC v5.10b)
  14.  lc -v -y helloworld    
  15.  
  16. Linked with:        (BLink v5.10b)
  17.  blink from helloworld.o to helloworld LIB lib:lc.lib lib:amiga.lib SC SD ND
  18.  
  19. (Final output file size = 232 ($000000e8) bytes)
  20. *********************************************************/
  21.  
  22. #include <exec/types.h>
  23. #include <exec/libraries.h>
  24. #include <libraries/dos.h>
  25. #include <proto/exec.h>
  26. #include <proto/dos.h>
  27.  
  28. char txt[] = "Hello world!\n";
  29.  
  30. int __regargs main(cnt,atext)
  31. int cnt;
  32. char *atext;
  33. {
  34. if (!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",0))) return(-1);
  35. Write(Output(),txt,strlen(txt));
  36. CloseLibrary((struct Library *)DOSBase);
  37. return(0);
  38. }
  39.