a little problem

Discussion in 'C Programming' started by ash, Jan 15, 2006.

  1. ash

    ash Guest

    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
     
    ash, Jan 15, 2006
    #1
    1. Advertising

  2. ash

    Ico Guest

    ash <> 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
     
    Ico, Jan 15, 2006
    #2
    1. Advertising

  3. ash

    osmium Guest

    "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.
     
    osmium, Jan 15, 2006
    #3
  4. ash

    Flash Gordon Guest

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

    ash Guest

    sorry friends,
    i was trying to post this problem to another group but accidently this
    was posted here
    thankx for ur help again
    ash
     
    ash, Jan 16, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave

    Little problem with WebForm

    Dave, Oct 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    313
  2. fsd

    Little Problem

    fsd, Dec 23, 2003, in forum: Java
    Replies:
    13
    Views:
    558
    Walter Mitty
    Dec 28, 2003
  3. fishfry
    Replies:
    7
    Views:
    473
    fishfry
    Mar 3, 2004
  4. ThaDoctor
    Replies:
    3
    Views:
    403
    Alan Woodland
    Sep 28, 2007
  5. Daniel
    Replies:
    1
    Views:
    223
    Bart van Ingen Schenau
    Jul 9, 2013
Loading...

Share This Page