473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Manually implementation of gotoXY( int, int ) function

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
4 4675
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Jef Driesen | last post by:
Suppose I have a datastructure (actually it's a graph) with one template parameter (the property P for each edge and vertex): struct graph<P>; struct vertex<P>; struct edge<P>; I also have...
1
by: mohsin | last post by:
hi can anyone tell me the name of the header file for gotoxy function in visual c++ i know k turbo c main iss ki header file dos.h hootee hai but i dontknow in vc++
4
by: Sergio Correia | last post by:
I'm writing a class, where one of the methods is kinda complex. The method uses a function which I know for certain will not be used anywhere else. This function does not require anything from...
6
by: arunk8186 | last post by:
Hi friends, When I compiled a program in which I have used gotoxy function in C , I get an error as "C:\Documents and Settings\e373616\Desktop\H1.cpp(58) : error C2065:...
17
by: Jason Doucette | last post by:
I am converting a C-style unit into a C++ class. I have an implementation function that was defined in the .cpp file (so it was hidden from the interface that exists in the .h file). It uses a...
26
by: Albert | last post by:
Hi Are there any definitions of the gotoxy function on the internet. My compiler doesn't define it in any header Albert
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...
0
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...
0
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 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.