home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------------ */
- /* GLOBALS */
- /* Management von globalen Variablen */
- /* ------------------------------------------------------ */
-
- //--------------------------------------- MAIN.CPP
- #include <stdio.h>
- #include <stdlib.h>
- #include "globals.h"
-
- void ProcessData(void);
- void PrintData(void);
-
- int main(void) {
- Global1 = 0x34;
- ProcessData();
- if (Global3 = 0x0000U)
- PrintData();
- return (Global2);
- }
-
- //--------------------------------------- GLOBALS.CPP
- int Global1;
- int Global2 = 0x0FFF;
- unsigned Global3 = 0xFFFF;
-
- //--------------------------------------- GLOBALS.H
- extern int Global1;
- extern int Global2;
- extern unsigned Global3;
-
- //--------------------------------------- PROCESS.CPP
- #include "globals.h"
- void ProcessData(void) {
- //.
- //.
- //.
- Global3 = 0x0000U;
- return;
- }
-
- //--------------------------------------- PRINT.CPP
- #include "globals.h"
- void PrintData(void) {
- //.
- //.
- //.
- Global2 = 0x0000;
- return;
- }
- /* ------------------------------------------------------ */
- /* Ende von GLOBALS */
-
-