Solved

Output

Posted on 2004-04-06
5
229 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
  • 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

803 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