473,396 Members | 1,760 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,396 software developers and data experts.

cursor position

2
the following is code.
when we get input the input should be within a squire briket.
how can the the cursor be blinking within squire briket [ ]
if any one have some idea please help me!

#include<iostream.h>
#include<conio.h>
#include<process.h>
int main()
{
clrscr();
int op;
cout<<"Your option---------------> [";
cin>>op;
cout<<"]";
getch();
return 0;

}
Nov 13 '08 #1
6 4386
mac11
256 100+
it might be overkill for what you need but you might want to look into ncurses - its a package that gives you lots of control over the terminal window.

http://www.gnu.org/software/ncurses/
http://en.wikipedia.org/wiki/Ncurses
http://web.cs.mun.ca/~rod/ncurses/ncurses.html

I'm sure there's more than one way to accomplish your goal - mabye conio has something but I don't know because I never program in windows/dos environments.
Nov 13 '08 #2
newb16
687 512MB
Borland c?
There must be something with XY in its name in conio.h, mentioned in builtin help.
Nov 13 '08 #3
weaknessforcats
9,208 Expert Mod 8TB
Maybe gotoxy? conio.h is non-standard so don't hold be to this.

Also, you should be using <iostream> and not <iostream.h>. iostream.h is pre-ANSI C++ and it went obsolete in 1998.
Nov 13 '08 #4
boxfish
469 Expert 256MB
Try printing the backspace character, \b.
Hope this helps.
Nov 13 '08 #5
newb16
687 512MB
Maybe gotoxy? conio.h is non-standard so don't hold be to this.
No, gotoxy is to set cursor coords, not to get them.
Ok, i managed to look in the help - they are wherex/wherey.

Also, you should be using <iostream> and not <iostream.h>. iostream.h is pre-ANSI C++ and it went obsolete in 1998.
He can't use because it will not compile then. Consider it as a legacy support project, where you can't use latest and greatest stuff despite how it is standard compliant.
Nov 13 '08 #6
boxfish
469 Expert 256MB
Just print "[ ]\b\b" and the cursor will be in between the two brackets.
Nov 13 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: PeP | last post by:
Good morning, I have a form containing a text-area, I'd like to know if it exists a function that, when I activate an event, returns the position of the cursor in the text-area. For example, I...
1
by: Dan H. | last post by:
Hello, I want to try to retrieve the cursor position x and y relative to the form the cursor is over. The way I am doing it now is: 1. Retrieve the left and top position of the form relative...
1
by: Tantra Veda | last post by:
Hello C# gurus, I have a question about finding cursor position in NumericUpDown control. On my form I have a numericUpDown control with 2 decimal places. I want to increment value in the numeric...
1
by: objectref | last post by:
Hi to all, we have the MousePosition property that we can get the Point of the position of the mouse cursor on the screen, but is it there a way to get the respective Point of a cursor in a...
1
by: Paul | last post by:
Hi all, I am making a DirectInput application wich must report correctly the cursor position in windowed mode (it means it has to be the same as Microsoft Window´s cursor position). First of...
22
by: DraguVaso | last post by:
Hi, For my application I need the following behavior: When I press F4 the cursor has to move to the next line in my multiline textbox which begins with "0". Finding lines starting with 0 isn't...
2
by: tony | last post by:
Hello! Assume I catch a double click in a form by using the event handler that forms designer create for me. Now to my question when I double click in the form the event handler is trigged...
1
by: jobs | last post by:
I'm trying to understand this and don't get it... I found some code that looks like it's going to work if I can make sense of how to position the div. The code displays a div with some data...
4
by: Billy | last post by:
Hi all, I'm building a text file from a database table using the ASP Write Method and would like to position the cursor in a specific column position before writing the fields. As I loop through...
4
by: mike | last post by:
I have the opportunity to rescue a project that uses a mouse to sense the relative position of a machine. The hardware is built...just needs to be programmed. Stop snickering!!! I didn't do it...I...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.