I am trying to write a program for a problem, which asks for moving the curser to different locations of the screen. I just want to get verification that I am running into the same issue of using an outdated text. The chapter instructions are to use the following code, and the details of how it works would be covered later on.
Code:
#include "dos.h"
cls()
{
union REGS i, o;
i.h.ah = 6;
i.h.al = 0;
i.h.ch = 0;
i.h.cl = 0;
i.h.dh = 24;
i.h.dl = 79;
i.h.bh = 7;
int86 ( 16, &i, &o);
}
gotorc ( int r, int c)
{
union REGS i, o;
i.h.ah = 2;
i.h.bh = 0;
i.h.dh = r;
i.h.dl = c;
int86 ( 16, &i, &o );
}
But when I use the above code in the following program, and I try to compile, I see the errors posted right after the code.
Code:
#include <stdio.h>
#include "goto.c"
int main()
{
gotorc ( 10, 30);
printf ("Just testing to see if I can use the goto.c file");
}
Code:
$ gcc test2.c -o test2
In file included from test2.c:2:0:
goto.c: In function 'cls':
goto.c:4:17: error: storage size of 'i' isn't known
union REGS i, o;
^
goto.c:4:20: error: storage size of 'o' isn't known
union REGS i, o;
^
goto.c: In function 'gotorc':
goto.c:18:17: error: storage size of 'i' isn't known
union REGS i, o;
^
goto.c:18:20: error: storage size of 'o' isn't known
union REGS i, o;
^