a little problem

A

ash

hi friends,

i was trying to make a function, which returns the scan code of a key
like up arrow,down arrow, right arrow and left arrow. here it is-

#include<dos.h>

int getkey()
{
union REGS i,o;

while(!kbhit())
;
i.h.ah=0;
int86(22,&i,&o);
return(o.h.ah);
}

and there was also rest of program but i didn`t mention here.

but when i try to compile it in BORLAND C++ 5.02 AND MICROSOFT VISUAL
C++ 6.0 ,it gives a lot of error i.e. union REGS not defined, i and o
undefined, int86 should have prototype and so on.
then i tried to compile same program in TURBO C 3.0 and it succeeded
and my program is working fine. I want to know why this piece of code
was giving error in borland 5.02 and VC++?
is there anyway to correct it.
thankx
ash
 
I

Ico

ash said:
i was trying to make a function, which returns the scan code of a key
like up arrow,down arrow, right arrow and left arrow. here it is-

#include<dos.h>

int getkey()
{
union REGS i,o;

while(!kbhit())
;
i.h.ah=0;
int86(22,&i,&o);
return(o.h.ah);
}

and there was also rest of program but i didn`t mention here.

but when i try to compile it in BORLAND C++ 5.02 AND MICROSOFT VISUAL
C++ 6.0 ,it gives a lot of error i.e. union REGS not defined, i and o
undefined, int86 should have prototype and so on. then i tried to
compile same program in TURBO C 3.0 and it succeeded and my program is
working fine. I want to know why this piece of code was giving error
in borland 5.02 and VC++? is there anyway to correct it. thankx ash

You have asked this exact question earlier today, and you have been
answered. You will *not* get any helpful or friendly answers by ignoring
replies and asking your question again; this is considered rude.

Go look at the responses to your previous thread, and go find out the
meaning of the word 'plonk'
 
O

osmium

ash said:
i was trying to make a function, which returns the scan code of a key
like up arrow,down arrow, right arrow and left arrow. here it is-

#include<dos.h>

int getkey()
{
union REGS i,o;

while(!kbhit())
;
i.h.ah=0;
int86(22,&i,&o);
return(o.h.ah);
}

and there was also rest of program but i didn`t mention here.

but when i try to compile it in BORLAND C++ 5.02 AND MICROSOFT VISUAL
C++ 6.0 ,it gives a lot of error i.e. union REGS not defined, i and o
undefined, int86 should have prototype and so on.
then i tried to compile same program in TURBO C 3.0 and it succeeded
and my program is working fine. I want to know why this piece of code
was giving error in borland 5.02 and VC++?
is there anyway to correct it.

Borland has apparently dropped some of the extensions that were provided in
Turbo C. They are entitled to do that since they were, exactly that,
extensions. You can use the old compiler or search for new way to
accomplish the same end. The new way is guaranteed to be much more
complicated than the way you have working on Turbo. The modern PC is no
longer a personal computer, and hasn't been for several years. All that
survived was the name, tough, but that's the way it is.

Discussing extensions is considered off-topic by most of the regulars on
this board so to pursue your problem you will have to go to some other
newsgroup.
 
F

Flash Gordon

ash said:
hi friends,

i was trying to make a function, which returns the scan code of a key
like up arrow,down arrow, right arrow and left arrow. here it is-

<snip>

The answer is exactly the same as you got in this thread
http://groups.google.co.uk/group/co...oup:comp.lang.c&rnum=4&hl=en#e064c4341090375e

If you want a different answer then post in a group where it is topical,
as was suggested rather than reposting an identical message under a
different subject. If you hadn't seen the replies, then you did not wait
long enough. Since this is not a chat room you should wait a couple of
days to see if people respond.
 
A

ash

sorry friends,
i was trying to post this problem to another group but accidently this
was posted here
thankx for ur help again
ash
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top