| ??? 01/10/08 18:41 Modified: 01/10/08 18:48 Read: times |
#149263 - Actually, I\'d do it more like this Responding to: ???'s previous message |
main.h // Public symbols from main.c // These are just declarations; the definitions are in main.c extern unsigned char data Sec, Min, Hr, Day; calc.h // Public symbols from calc.c
// These are just declarations; the definitions are in calc.c
extern unsigned char code Zero [] = {0x03, 0x61, 0x11, 0x03};
extern unsigned int Value = 0;
extern unsigned char dat;main.c #include "main.h" // Declarations only #include "calc.h" // Declarations only // Now provide the definitions of the public symbols for main: // It doesn't matter that the declarations have been included; // in fact, including the declarations means that the compiler will spot any inconsistencies! unsigned char data Sec, Min, Hr, Day; calc.c #include "main.h" // Declarations only
#include "calc.h" // Declarations only
// Now provide the definitions of the public symbols for calc:
unsigned char code Zero [] = {0x03, 0x61, 0x11, 0x03};
unsigned int Value = 0;
unsigned char dat; |



