473,414 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

a little problem

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

Jan 15 '06 #1
4 2506
Ico
ash <as************@rediffmail.com> wrote:

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'
--
:wq
^X^Cy^K^X^C^C^C^C
Jan 15 '06 #2
"ash" writes:
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.
Jan 15 '06 #3
ash wrote:
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/com...64c4341090375e

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.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Jan 15 '06 #4
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

Jan 16 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ClimberBear | last post by:
Hi, I've got a very strange problem with a Websphere 5.1 cluster attached to DB2 database in Mainframe z/OS. I have a J2EE deployed application running normally fine agains the DB2 host. But,...
38
by: Martin Marcher | last post by:
Hi, I've read several questions and often the answer was 'C knows nothing about .' So if C knows that little as some people say, what are the benefits, I mean do other languages know more...
8
by: Perception | last post by:
Hello all, If I have a C-like data structure such that struct Data { int a; //16-bit value char; //3 ASCII characters int b; //32-bit value int c; //24-bit value }
14
by: Henk | last post by:
Hi Guys, (see actual code below) I wrote a little program that is supposed to read a file (input.txt) into memory (using a stack) and then reverse the file and display it to output. It works,...
0
by: Angel J. Hernández M | last post by:
Hi folks! I'm having a little problem and I'm a bit confused about it. See... I'm working on this VoIP project (I need to use make direct calls to Windows API). I started working using C# but since...
5
by: Bit byte | last post by:
I have the following methods: static void Foo::setBar(const Bar*) ; //store a copy of Bar static const Bar* Foo::getBar(void) const ; //return an UNMODIFIABLE ptr to our internal copy In...
2
by: petermichaux | last post by:
Hi, It seems like determining element position in a web page is a difficult task. In the position reporting source code I've looked at there are special fixes for at least some versions of...
4
by: Batmanuel | last post by:
Good evening people, little question here... I'm trying to get this file upload script to work but it tells me that move_uploaded_file() fails because it doesn't have permission for the /tmp...
8
by: Andrew Savige | last post by:
I'm learning Python by reading David Beazley's "Python Essential Reference" book and writing a few toy programs. To get a feel for hashes and sorting, I set myself this little problem today (not...
3
by: Ethan Furman | last post by:
len wrote: I've never had the (mis?)fortune to work with COBOL -- what are the files like? Fixed format, or something like a dBase III style? I
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.