home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9202 / borhot / globals. < prev    next >
Encoding:
Text File  |  1992-01-07  |  1.2 KB  |  54 lines

  1. /* ------------------------------------------------------ */
  2. /*                     GLOBALS                            */
  3. /*           Management von globalen Variablen            */
  4. /* ------------------------------------------------------ */
  5.  
  6. //--------------------------------------- MAIN.CPP
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include "globals.h"
  10.  
  11. void ProcessData(void);
  12. void PrintData(void);
  13.  
  14. int main(void) {
  15.   Global1 = 0x34;
  16.   ProcessData();
  17.   if (Global3 = 0x0000U)
  18.     PrintData();
  19.   return (Global2);
  20. }
  21.  
  22. //--------------------------------------- GLOBALS.CPP
  23. int Global1;
  24. int Global2 = 0x0FFF;
  25. unsigned Global3 = 0xFFFF;
  26.  
  27. //--------------------------------------- GLOBALS.H
  28. extern int Global1;
  29. extern int Global2;
  30. extern unsigned Global3;
  31.  
  32. //--------------------------------------- PROCESS.CPP
  33. #include "globals.h"
  34. void ProcessData(void) {
  35.   //.
  36.   //.
  37.   //.
  38.   Global3 = 0x0000U;
  39.   return;
  40. }
  41.  
  42. //--------------------------------------- PRINT.CPP
  43. #include "globals.h"
  44. void PrintData(void) {
  45.   //.
  46.   //.
  47.   //.
  48.   Global2 = 0x0000;
  49.   return;
  50. }
  51. /* ------------------------------------------------------ */
  52. /*                   Ende von GLOBALS                     */
  53.  
  54.