Solved

Output

Posted on 2004-04-06
5
245 Views
Last Modified: 2010-04-01
Hi,
   Say if my output screen have five lines, how would I do a line up and a line down without printing it out all over? For example, if my current display is:
        1                                                    2                                        1
        2                                                    3                                        2
        3      ->  perform one line down        4    -> perform on line up     3
        4                                                    5                                        4
        5                                                    6                                        5

Is this possible without gui?

Nick
0
Comment
Question by:SolverSurfer
[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
5 Comments
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10764405
U can use gotoxy() to set the cursor's current position
0
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10764413
For borland compilers,its defined under conio.h

FOR vc++,u can write ur own:
http://oldlook.experts-exchange.com:8080/Programming/Programming_Languages/C/Q_20913075.html
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 500 total points
ID: 10764445
gotoxy(int,int) is called with 2 integer parameters,first is the column number starting from 1
and the second is the row number starting from 1.

gotoxy(1,12);//1st col. and 12th row
printf("%d",3);
//some other statements
gotoxy(1,12);//1st col. and 12th row
printf("%d",4);
0
 
LVL 9

Expert Comment

by:ankuratvb
ID: 10764473
what u can do is:
use gotoxy() and printf() and shift each value up one row and then  add the last value.
and shift each value down one row and add one value at the top.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

710 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