Solved

Output

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

762 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

21 Experts available now in Live!

Get 1:1 Help Now