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 2 1554
ash said: 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++?
Because what you wrote is not actually standard C. I mean, the syntax is
standard enough, but the stuff you were using (int86() calls, REGS unions,
and all that) was a pile of extensions that were common to MS-DOS compilers
back in the 1980s and early 1990s (hence "dos.h"), but which fell out of
favour when Microsoft (R) Windows (TM) 95 (aka 4) was introduced.
is there anyway to correct it.
If you need *that* code to work, use a very old MS-DOS compiler (I keep
several around, just in case!). If you just need that functionality, yes,
there are more "modern" ways to do it, but none of those ways can be
followed in standard C - every implementation does it in its own way, it
seems - which is a nuisance. Since, presumably, you are on a Windows
platform, comp.os.ms-windows.programmer.win32 would be your next port of
call.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
On 14 Jan 2006 22:22:07 -0800, in comp.lang.c , "ash"
<as************@rediffmail.com> wrote: hi friends,
i was trying to make a function, which returns the scan code of a key
See the FAQ, section 19
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.
Different compilers have different abilities. Different OSes have
different abilities. For further details, ask again in a Windows
programming group as how you would do it under Unix, VMS, etc would be
totally different, and all would be offtopic in CLC.
Mark McIntyre
--
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Python Baby |
last post by:
I'm about to try a little test project in Python, but want to make sure
I'm on the right foot.
Any advice appreciated before I start this. MOST important : I want
to make sure I'm not just...
|
by: Adam Schroeder |
last post by:
I'm a computer science student looking for a little advice on network
programming using TCP/IP? I'm using Borland's 5.02 compiler, but I could
use Dev C++ if you advise that... is there any...
|
by: gary |
last post by:
Hi,
1. About all C/C++ compilers, Does stack increase from high address to low address and heap grow increase from low to high? What on earth decides their increase direction, CPU architecture, OS...
|
by: Daniel |
last post by:
I'm new to .Net and all of its abilities so I hope this makes sense.
Basically I'm confused on when is the appropriate time to use web forms
controls vs. regular HTML.
For example in ASP...
|
by: John Salerno |
last post by:
My first project when I started learning C# was to make a little timer
to tell me when my laundry was done :) and I thought it would be fun to
convert this to Python. Here's what I came up with...
| |
by: manochavishal |
last post by:
Hi ,
Ihave this code to show binary of an integer.
#include<stdio.h>
#include<stdlib.h>
typedef struct binary* binaryptr;
typedef struct binary
{
int data;
|
by: ash |
last post by:
i am writing this program (for exercise1-9 in k&r-2nd edition) which
removes extra spaces in string
example- "test string" will be "test string"
#include<stdio.h>
#include<string.h>...
|
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...
|
by: shapper |
last post by:
Hello,
I need to create a data object to hold a number of records with 3
columns. A datatable would do.
My problem is this:
1. I will use this as a GridView datasource.
2. I will need to...
|
by: Karl |
last post by:
I normally only use A2000 but I need to do a little project in VB2005
But I can't figure out how to open the backend Access table in code and add
data using code. I don't need to bind to a form....
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |