LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-04-2005, 09:11 AM   #1
isaac_linux
Member
 
Registered: Nov 2003
Location: India
Posts: 30

Rep: Reputation: 15
gotoxy() in Linux


I have used gotoxy() functions in TUrBO C in DOS to printf a character at the specified location. But I don't how to do that in LINUX. can any body help me?
 
Old 01-04-2005, 11:38 AM   #2
greeneagle
Member
 
Registered: Dec 2004
Location: Dublin Ireland via Cobh, Limerick.
Distribution: RedHat, Suse, Ubuntu.
Posts: 33

Rep: Reputation: 16
you need curses

curses as in libcurses and curses.h that is

grep the web for curses examples

move(x,y) would be equivalent of gotoxy

gcc -lcurses ~/c/curseexample.c -o ~/c/curseexample

#include <curses.h>

main()
{
int x,y;
int f1,f2,f;
WINDOW *w;

w = initscr();

clear();

for (x=0;x<20;x++){
for (y=0;y<20;y++){
move(x,y);
addch('A'+x+y);
}
f = refresh();
}

f1 = move(10,10);
f2 = addstr("10,10");
f = printw("f is %d,%d\n",f1,f2);
f = refresh();

f = move(0,0);
f = addstr("0,0");
f = refresh();

// DO not use printf or other non-curses while doing curses!
// printf("HEYf is %d\n",f);

sleep(10);
endwin();

printf("non curses\n");
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration