By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,694 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,694 IT Pros & Developers. It's quick & easy.

Manually implementation of gotoXY( int, int ) function

P: n/a
Hi! I'm using visual studio 6.0 and I need to interact with DOS
console. I know the conio.h library but, under visual studio, it
doesn't provide useful functoins like gotoXY( int, int ) etc.... My
question is: is there a method to implement manually this kind of
functions with standard library or do I have to interact directly with
Windows's API?

Thanks

Feb 18 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 18 Feb 2006 07:20:36 -0800, "Teo81" <bb****@yahoo.it> wrote in
comp.lang.c:
Hi! I'm using visual studio 6.0 and I need to interact with DOS
console. I know the conio.h library but, under visual studio, it
doesn't provide useful functoins like gotoXY( int, int ) etc.... My
question is: is there a method to implement manually this kind of
functions with standard library or do I have to interact directly with
Windows's API?

Thanks


There is absolutely no way at all to implement any sort of video
display control directly in standard C. C does not talk to devices
like keyboards, video displays, printers, etc. All C input and output
is defined in terms of FILE * streams prototyped in <stdio.h>. It is
up to the underlying operating system to connect these streams to disk
files or devices.

Windows does provide a large number of functions for console
applications. A good place to start looking at them is:

http://msdn.microsoft.com/library/de...plications.asp

Note that this is a platform specific issue, and not a C language one.
Future questions about this topic should be asked in a group like
news:comp.os.ms-windows.programmer.win32, or in one of Microsoft's
groups in the news:microsoft.public.* family.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 18 '06 #2

P: n/a
Jack Klein <ja*******@spamcop.net> writes:
[...]
There is absolutely no way at all to implement any sort of video
display control directly in standard C. C does not talk to devices
like keyboards, video displays, printers, etc. All C input and output
is defined in terms of FILE * streams prototyped in <stdio.h>. It is
up to the underlying operating system to connect these streams to disk
files or devices.


Basically true, but I think it overstates it a bit. There is no
*portable* way to implement video display control in standard C, but
you can implement it non-portably (given a few assumptions) without
resorting to any non-standard features or libraries. Such code
depends on implementation-defined behavior. (For example, if you
assume a VT100-style or xterm-style terminal, you can write control
codes to stdout.)

But the best way to do this kind of thing is usually to use some
system-specific library such as curses, ncurses, or whatever Windows
provides.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 18 '06 #3

P: n/a
"Keith Thompson" <ks***@mib.org> wrote
Basically true, but I think it overstates it a bit. There is no
*portable* way to implement video display control in standard C, but
you can implement it non-portably (given a few assumptions) without
resorting to any non-standard features or libraries. Such code
depends on implementation-defined behavior. (For example, if you
assume a VT100-style or xterm-style terminal, you can write control
codes to stdout.)

But the best way to do this kind of thing is usually to use some
system-specific library such as curses, ncurses, or whatever Windows
provides.

In the bad old days computer manufacturers used to provide IO libraries
which were useless for any type of professional programming, because they
updated the screen too slowly. So you had to hack into the system and write
directly to screen memory, or use other tricks.

That is no longer usually true, because a modern processor is usually fast
enough to update the screen every video refresh. So you are better off using
the proper libraries.
--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $6.90 paper, available www.lulu.com
Feb 19 '06 #4

P: n/a
Groovy hepcat Teo81 was jivin' on 18 Feb 2006 07:20:36 -0800 in
comp.lang.c.
Manually implementation of gotoXY( int, int ) function's a cool scene!
Dig it!
Hi! I'm using visual studio 6.0 and I need to interact with DOS
console. I know the conio.h library but, under visual studio, it
doesn't provide useful functoins like gotoXY( int, int ) etc.... My
question is: is there a method to implement manually this kind of
functions with standard library or do I have to interact directly with
Windows's API?


This can't be done in standard C. It can only be done by
non-portable means.
I could be wrong, but I believe the Visual Studio compiler is a
Windows compiler. It cannot, therefore, interact directly with DOS.
You need a DOS compiler for that.
Once you have a DOS compiler, go to comp.os.msdos.programmer and ask
your question, as it is off topic here in comp.lang.c.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Feb 21 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.