Solved

input and get an answer at same line?

Posted on 2004-04-15
15
183 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
  • 4
  • 4
  • 2
  • +2
15 Comments
 
LVL 5

Expert Comment

by:info_expert
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 4

Expert Comment

by:caner_elci
Comment Utility
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
Comment Utility
Could you please show us your code ?
0
 
LVL 4

Expert Comment

by:caner_elci
Comment Utility
Alright, but in a few hours.. I need a compiler first :)
By the way, what compiler and OS do you use?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Expert Comment

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

Expert Comment

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

Expert Comment

by:caner_elci
Comment Utility
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
Comment Utility
I use VS 6
0
 
LVL 5

Expert Comment

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

Got?
0
 

Author Comment

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

Accepted Solution

by:
GhostMod earned 0 total points
Comment Utility
PAQed, with points refunded (75)

GhostMod
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now