![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux programming | venkatgopu | Linux | 2 | 09-14-2009 07:14 AM |
| c programming in linux | convenientstore | High Level Programming | 6 | 04-07-2008 03:30 PM |
| Need Help Of Linux Programming | luckyvishwa | Linux | 1 | 01-01-2007 06:47 AM |
| Programming C in Linux | wizkid | High Level Programming | 2 | 05-21-2001 08:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi friends
In my linux application, i want to update output in same place i.e.. I want to display my output in specific location in screen(console output) ITERATION 1: (e.g. start diplay from 5th ROW 5th COLOUMN) if my message is "hi" then first time 'h' should print in 5th ROW 5th COL and 'i' should print in 5th ROW and 6th COL. ITERATION 2: (e.g. start diplay from 5th ROW 5th COLOUMN) second time 'h' should print in 5th ROW 5th COL and 'i' should print in 5th ROW and 6th COL. . . ITERATION n: (e.g. start diplay from 5th ROW 5th COLOUMN) nth time 'h' should print in 5th ROW 5th COL and 'i' should print in 5th ROW and 6th COL. Can you please give me simple program?... I think, this program tell you that what i am expecting? #include<stdio.h> int main () { while(1) { printf("hi"); } return 0; } output: r0c0c1c2c3c4c5c6c7c8c9c10.... row->r hihihihihihihihihihihihihihi.......infinite loop col->c But, i need to display this "hi" in same place in screen(console output) output must be: r5c1c2c3c4c5c6 ................h i (when i press ctrl+c to terminate infinite loop) In short, i want to overwrite "hi". Thanks & Regards Venkat Gopu Last edited by venkatgopu; 09-24-2009 at 12:55 AM.. |
|
||||
|
Your program so far needs stdio.h, which you'd include at the top of your file like
Code:
#include <stdio.h> |
|
||||
|
Quote:
Code:
#include<stdio.h>
int main ()
{
while(1)
{
printf("\rhi");
}
return 0;
}
Code:
#include <stdio.h>
void cls(void) // clear screen
{ printf("\033[2J"); }
void gotoxy(int x, int y) // go to coordinates
{ printf("\033[%d;%dH", y, x); }
int main(void)
{
cls();
gotoxy(50,5);
printf("hi\n");
}
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|