Solved

Output

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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.

820 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