home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 03 / review / demo.c next >
Encoding:
C/C++ Source or Header  |  1991-02-06  |  1.1 KB  |  52 lines

  1. /* --------------------------------------------------- */
  2. /*  Programm für den Test der Kontrollfähigkeit eines  */
  3. /*                   C-Compilers                       */
  4. /*            (C) 1991 C. van Hoven & TOOLBOX          */
  5. /* --------------------------------------------------- */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <conio.h>
  10. #include <string.h>
  11.  
  12. #define NANU = 2
  13. #define PING   1
  14. #define PONG  -1
  15.  
  16. int Quadrat(double a);
  17.  
  18. struct iGitt
  19.       {
  20.         int oho, aha;
  21.       }
  22.  
  23. main()
  24. {
  25.   int banane=0, apfel=PING-PONG, birne;
  26.   unsigned int erbse=2, gurke=-1;
  27.   volatile unsigned int *zwiebel=&erbse;
  28.   char *tisch = 'T', *stuhl, sessel;
  29.   double wolke=1.2;
  30.  
  31.   strcpy(stuhl, "hello world!");
  32.   printf("Ergebnis 1: %d %d %d\n",
  33.           banane, apfel);
  34.   if(gurke<0)
  35.     Quadrat(wolke);
  36.   apfel=banane+++birne;
  37.   erbse=*zwiebel + *zwiebel;
  38.   printf("Ergebnis 2: %d %d %d\n",
  39.           banane, apfel, wolke);
  40.   getch;
  41.   printf('\a');
  42. }
  43.  
  44. int Quadrat(double a)
  45. {
  46.   /* Nur von positiven Zahlen * /
  47.   if(a>0.0)
  48.     return(a*a);
  49.   /* Nicht von negativen Zahlen */
  50.   return(0.0);
  51. }
  52.