Solved

Output

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ - Convert a wString to char * 9 496
C Language combined operators 28 106
computer science syllabus 3 69
How to print into std::string like sprintf using C++11? 12 47
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

948 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

22 Experts available now in Live!

Get 1:1 Help Now