I have a major problem with the union REGS regs command in C. I have a program, source below, that generates errors whenever I compile. I've used Borland C++ 6.0, Visual Studio.NET, and Borland C++ 5.5. All of said compilers on Windows 2k, and all generating same errors, saying that structures are not defined. Do I have to create the structure?
Code below:
Code below:
Code:
// Local variables.
union REGS dRegs;
union REGS mRegs;
union REGS tRegs;
unsigned int year;
unsigned char day;
unsigned char hours;
unsigned char leapYears;
unsigned char minutes;
unsigned char month;
unsigned char seconds;
// Get the current date and time.
mRegs.h.ah = 0x2A;
int86(&mRegs,&mRegs);
tRegs.h.ah = 0x2C;
int86(&tRegs,&tRegs);
dRegs.h.ah = 0x2A;
int86(&dRegs,&dRegs);