home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / libs / plotlib.lha / Plot_2.lzh / Examples / bsp2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-08  |  534 b   |  43 lines

  1. #include <stdio.h>
  2. #include <plot/plotlib.h>
  3.  
  4. DATA quadrat(x)
  5. DATA x;
  6. {
  7.     return(x*x);
  8. }
  9.  
  10. main()
  11. {
  12.     int erfolg,id;
  13.     char a;
  14.  
  15.     erfolg = open_plot();
  16.     if (!erfolg)
  17.     {
  18.         dis_ploterror();
  19.         exit(5);
  20.     }
  21.  
  22.     id = get_data(quadrat,-4.0,4.0,300);
  23.     if (!id)
  24.         dis_ploterror();
  25.     else
  26.     {
  27.         erfolg = display(SCREENOUT,GRAPHNOTSET);
  28.         if (!erfolg)
  29.             dis_ploterror();
  30.         else
  31.         {
  32.             a = getchar();
  33.             erfolg  = display(SCREENCLOSE,NULL);
  34.             if (!erfolg)
  35.                 dis_ploterror();
  36.         }
  37.     }
  38.     erfolg = close_plot();
  39.     if (!erfolg)
  40.         dis_ploterror();
  41.     exit(0);
  42. }
  43.