CreoN
Jul 9th, 2001, 04:00 PM
I found an example in a book about making graphics in C (a very short example). It was using
union REGS regs;
I tried to compile it, and I got the first error on that line (all the other error were because of that...)
Anyway, I looked up REGS in the BCB-help, and found an example...
/* int86 example */
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define VIDEO 0x10
void movetoxy(int x, int y)
{
union REGS regs;
regs.h.ah = 2; /* set cursor position */
regs.h.dh = y;
regs.h.dl = x;
regs.h.bh = 0; /* video page 0 */
int86(VIDEO, ®s, ®s);
}
int main(void)
{
clrscr();
movetoxy(35, 10);
printf("Hello\n");
return 0;
}
Compiled this, and got en error. Same thing.. the union-line. I sat down to look through some include-files if I could find REGS somewhere, but no result.
So.. does anyone have a suggestion for what I might do? All examples in the book uses this, so I can't move on making cool stuff :)
union REGS regs;
I tried to compile it, and I got the first error on that line (all the other error were because of that...)
Anyway, I looked up REGS in the BCB-help, and found an example...
/* int86 example */
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define VIDEO 0x10
void movetoxy(int x, int y)
{
union REGS regs;
regs.h.ah = 2; /* set cursor position */
regs.h.dh = y;
regs.h.dl = x;
regs.h.bh = 0; /* video page 0 */
int86(VIDEO, ®s, ®s);
}
int main(void)
{
clrscr();
movetoxy(35, 10);
printf("Hello\n");
return 0;
}
Compiled this, and got en error. Same thing.. the union-line. I sat down to look through some include-files if I could find REGS somewhere, but no result.
So.. does anyone have a suggestion for what I might do? All examples in the book uses this, so I can't move on making cool stuff :)