Jump to content
  • Advertisement
Sign in to follow this  
t5hoo6

Why, won't this work?

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am tring to use locate but it is not working here is my code #include <stdio.h> void main() { locate (6,7); printf("W"); } what is wrong with it? [Edited by - t5hoo6 on August 15, 2005 6:12:16 PM]

Share this post


Link to post
Share on other sites
Advertisement
locate is not a standard C language function. You are going to have to write it yourself, or find a library that has a locate function that does what you want.

Share this post


Link to post
Share on other sites
I looked and this is the code:


#include <stdio.h>
#include <stdlib.h>
#include <dos.h>

void locate(int col,int row);

void main()
{
locate (5,6);
printf("U");
}

void locate(int col,int row)
{
union REGS regs;

regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=row;
regs.h.dl=col;
int86(VIDEO,®s,®s);
}


It still did not compile it dose not reconize REGS or regs.

Share this post


Link to post
Share on other sites
Quote:
Original post by t5hoo6
I looked and this is the code:


#include <stdio.h>
#include <stdlib.h>
#include <dos.h>

void locate(int col,int row);

void main()
{
locate (5,6);
printf("U");
}

void locate(int col,int row)
{
union REGS regs;

regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=row;
regs.h.dl=col;
int86(VIDEO,®s,®s);
}


It still did not compile it dose not reconize REGS or regs.


Wait, are you trying to compile this on a UNIX variant? The dos.h header contains DOS specific functions.

Share this post


Link to post
Share on other sites
I asked because this is the Everything Unix forum.
Never heard of C-Free. Maybe it doesn't have dos.h (or maybe it has an incomplete one).

Share this post


Link to post
Share on other sites
That code looks like Borland Turbo C for DOS specific code. If you don't have Borland Turbo C for DOS or Borland Turbo C++ for DOS you probably won't be able to use it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!