?
Solved

input and get an answer at same line?

Posted on 2004-04-15
15
Medium Priority
?
187 Views
Last Modified: 2010-04-01
whenever i ask the user to enter data in ms-dos, the user enters something on the keyboard and then presses enter and sees the outout on the next line. Is there any way i can see the output at same line?
0
Comment
Question by:Carl3003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
15 Comments
 
LVL 5

Expert Comment

by:info_expert
ID: 10839564
You can give the position of out put by just using the function gotoxy(x,y)\

Just use this function in this way:

gotoxy(x,y);
cout<<//your output;


Regards.
0
 

Author Comment

by:Carl3003
ID: 10839806
thanks, its an intersting idea but the user would need to enter huge  bunch of data and that would cause me lots of troubles outputing data
0
 

Author Comment

by:Carl3003
ID: 10839821
And the thing is that i dont know when the user will want to output the data, thats why x,y should be always increasing
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:caner_elci
ID: 10840157
You should write your own input function.. A loop with getch() from stdin and waits for CR.. but you will need to implement arrow keys (if you want), backspace etc... and at the end, you won't print CR, that's it..
0
 
LVL 6

Expert Comment

by:Mafalda
ID: 10841575
Could you please show us your code ?
0
 
LVL 4

Expert Comment

by:caner_elci
ID: 10841767
Alright, but in a few hours.. I need a compiler first :)
By the way, what compiler and OS do you use?
0
 
LVL 4

Expert Comment

by:caner_elci
ID: 10841789
A misunderstanding? do you wanna see my code, or Carl's code?
0
 
LVL 6

Expert Comment

by:Mafalda
ID: 10841825
The code of Carl3003 of course ;o)
The one doing this input output stuff
0
 
LVL 4

Expert Comment

by:caner_elci
ID: 10841900
Yeah, I thought so :)
In fact the problem is that I didn't check you posted that comment and thought Carl3003 did it :) Anyway, I am willing to show you a code.. soon :))
0
 

Author Comment

by:Carl3003
ID: 10847572
I use VS 6
0
 
LVL 5

Expert Comment

by:info_expert
ID: 10852500
Ok then, use getx and gety functions to get the current positins of the cursor.

Got?
0
 

Author Comment

by:Carl3003
ID: 10855100
do you  have any sample code how to use getx?
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 11227159
PAQed, with points refunded (75)

GhostMod
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question