473,378 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to read a character from a particular location on console?

Hi,
I need to read individual characters from the console (in DOS) using
C. Is there some function like getxy(char,x,y) ?

thanks in advance,
Prashanth Ellina
Nov 14 '05 #1
4 1565
Prashanth Ellina <pr*************@hotpop.com> scribbled the following:
Hi,
I need to read individual characters from the console (in DOS) using
C. Is there some function like getxy(char,x,y) ?


Not in standard C, there isn't. Standard C doesn't even know there *is*
a console in the first place.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don't feed it!"
- Anon
Nov 14 '05 #2

"Prashanth Ellina" <pr*************@hotpop.com> wrote in message

I need to read individual characters from the console (in DOS)
using C. Is there some function like getxy(char,x,y) ?

There may possibly be an extension to ANSI C that provides this and that
ships with your compiler.
Also you can often write these sorts of functions yourself by messing about
with the video buffer (obtained in a system-specific way).

However ANSI C offers no facilities for consoles other than stdin and
stdout, which you would know if you read the FAQ.
Nov 14 '05 #3
pr*************@hotpop.com (Prashanth Ellina) writes:
Hi,
I need to read individual characters from the console (in DOS) using
C. Is there some function like getxy(char,x,y) ?


There is no standard C function to do this, and there are plenty of
implementations where this isn't even possible. Try a DOS-specific
newsgroup.

--
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.
Nov 14 '05 #4
Thanks a lot people,will try in a DOS group

Keith Thompson <ks***@mib.org> wrote in message news:<ln************@nuthaus.mib.org>...
pr*************@hotpop.com (Prashanth Ellina) writes:
Hi,
I need to read individual characters from the console (in DOS) using
C. Is there some function like getxy(char,x,y) ?


There is no standard C function to do this, and there are plenty of
implementations where this isn't even possible. Try a DOS-specific
newsgroup.

Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeff Learman | last post by:
I want to do a very simple thing in Windows. (Using Python Shell.) I want to write a prompt to sys.stdout and read the user input. (Ideally, without waiting for a newline.) Here are the...
2
by: SHC | last post by:
Hi all, I ran the attached volcanoes.xml (with geology.dtd) in the Module of Access 2003. I got the following error: Microsoft Office Access You have error Invalid Character in content model....
19
by: Mark Richards | last post by:
I've been programming for many years, but have only recently taken a deep "C" dive (bad pun, i know) and need a lot of explanation from an expert. My questions center around those mysterious...
5
by: Pete | last post by:
I having a problem reading all characters from a file. What I'm trying to do is open a file with "for now" a 32bit hex value 0x8FB4902F which I want to && with a mask 0xFF000000 then >> right...
3
by: Jerry | last post by:
I am having problem with Console.Read(), the Value I entered is not the value that store in my variable. public class Num { int num; Console.Write("Enter a number: "); num=Console.Read();...
3
by: - Steve - | last post by:
Okay I call Console.Read() twice. However when I come up on my second Console.Read() ASCII character 10 is already on the console (that's a line feed). How do I clear out that line feed before...
4
by: Henry | last post by:
for the following code snippet: int k; char c; while (true) { k = Console.Read (); if (k == -1) break; c = (char) k; Console.WriteLine ("Echo: {0}", c);
9
by: jraul | last post by:
1) Am I correct that C++ does not have a defined character set? In particular, a platform might not use the ASCII character set? 2) C++ supports wchar_t types. But again, this has no defined...
2
by: Jade Lee | last post by:
Hi. I want to read a character from console, while writing something to the console. And if, there were no input character in some seconds, then I wish to continue to writing to the console....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.