I write this program in a code block, but I am having an error stray 302 in int86(0x33, ®s, ®s);
. My program is:
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <graphics.h>
void theend();
static int mask[] =
{
/* Screen mask */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000,
/* Cursor mask */
0x0000, 0x0000, 0x381c, 0x7c3e, 0x7c3e, 0x7c3e, 0x7c3e,
0x3bdc, 0x07e0, 0x0ff0, 0x0ff0, 0x0ff0, 0x0ff0, 0x07e0,
0x03c0, 0x0000
};
void main()
{
int gdriver = DETECT, gmode, buttons;
union REGS regs;
struct SREGS sregs;
initgraph(&gdriver, &gmode, "");
regs.x.ax = 0; /* Initialize mouse */
int86(0x33, ®s, ®s);
setcolor(LIGHTCYAN);
if(regs.x.ax == 0)
{
outtextxy(0, 0, "NO MOUSE AVAILABLE");
getch();
theend();
}
regs.x.ax = 9; /* Change cursor shape */
regs.x.bx = 5;
regs.x.cx = 0;
regs.x.dx = (int)mask;
segread(&sregs);
sregs.es = sregs.ds;
int86x(0x33, ®s, ®s, &sregs);
regs.x.ax = 1; /* Show mouse pointer */
int86(0x33, ®s, ®s);
do
{
regs.x.ax = 3;
int86(0x33, ®s, ®s);
buttons = regs.x.bx & 3;
} while(buttons != 3);
regs.x.ax = 2; /* Hide mouse pointer */
int86(0x33, ®s, ®s);
theend();
}
void theend()
{
closegraph();
}
I find some blog where it writes about the dos.h
file. Is it work full to see the dos.h
file? Is there a difference between the new dos.h
file and the old dos.h
file?
dos.h
&conio.h
is not a standard header. If you want some GUI interface use some toolkit like Qt or libsdl... – Lattimore®s
supposed to be?? – Berrierror: stray \302. error: stray \256.
" (for each one of those characters (a single character giving rise to two compiler errors (or at least as reported))). – Orazio\x{00AE}
in any modern text editor or IDE (note: The notation is different in Visual Studio Code (and probably others):\u00AE
(instead of\x{00AE}
)). There are 10 instances of this character in the code as posted. There aren't any other strange characters of the common ones often encountered, e.g. NO-BREAK SPACE, ZERO WIDTH SPACE, ZERO WIDTH NON-JOINER, ZERO WIDTH NO-BREAK SPACE, EN DASH, EM DASH, LEFT DOUBLE QUOTATION MARK, RIGHT DOUBLE QUOTATION MARK, MINUS SIGN, etc. – Orazio®
being autocompleted (by the user?) to the HTML character entity reference®
and then automatically converted into U+00AB (REGISTERED SIGN), ®. – Orazio