| Forum |
|
|||||||
| Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Human Spambot
Join Date: Jan 2007
Location: Lat 28.38°N , Longt 77.13°E
Posts: 2,429
|
|
|
|
| Advertisements. Register and be a member of the community to get rid of them. | |
|
Advertisement
|
|
|
|
#2 (permalink) |
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,657
|
There are alternatives upto a possible-extent available in the ncurses libraries (Only available for POSIX systems). Link has a tutorial too, the basics are easy stuff
There are clear() and move() functions in ncurses that can help. Code:
man curs_clear man curs_move # For more help.
__________________
Harsh J www.harshj.com |
|
|
|
|
#3 (permalink) |
|
God of Mistakes...
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,905
|
or use system("clear"); or system("cls") which don't require any external lib. But thats not a good practice. But it servers the purpose !
__________________
Registered Linux User #468778 ---------------------------------- http://twitter.com/_Garbage_ |
|
|
|
|
#5 (permalink) |
|
Alpha Geek
Join Date: Jun 2004
Location: Noida - India
Posts: 764
|
include stdlib.h in your program.
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 Samsung Omnia Pro B7610 with Stock WM 6.1 ROM Blog: http://www.sumitbhardwaj.co.in/blog |
|
|
|
|
#7 (permalink) |
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,657
|
"clear" will not always work cause Linux's method of clearing the terminal is different than Windows and will sometimes give you good WTF moments
system() not being found is very weird indeed, I have clue on this, but try including <stdlib.h> or <cstdlib> if C++...
__________________
Harsh J www.harshj.com |
|
|
|
|
#8 (permalink) | |
|
Human Spambot
Join Date: Jan 2007
Location: Lat 28.38°N , Longt 77.13°E
Posts: 2,429
|
No error given be compiler with stdlib but still not clearing the screen.
Quote:
|
|
|
|
|
|
#9 (permalink) |
|
God of Mistakes...
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,905
|
If using windows then try system("cls"); n if *nix then system("clear");
Actually, system() passes argument directly to shell...
__________________
Registered Linux User #468778 ---------------------------------- http://twitter.com/_Garbage_ |
|
|
|
|
#10 (permalink) |
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,657
|
Ah yes I did forget to include a "no". But system("clear") will not help in the same way as clrscr() of conio.h. The only way is ncurses if you want all features of dos.h/conio.h/etc windows stuff, and its a lot more powerful than that. You might just love it, why not give the link's tutorial a try? I liked it!
__________________
Harsh J www.harshj.com |
|
|
|
|
#11 (permalink) |
|
Alpha Geek
Join Date: Jun 2004
Location: Noida - India
Posts: 764
|
I guess you want some kind of unified solution so that your program works fine whether compiling in Windows or Linux. For that you'll have to do the one time dirty task of creating the "unified versions" of these functions in one of your custom header file. use #ifdef construct to comment out sections of your code that are irrelevent while running on a particular OS. Best way to create these unified version is to use ncurses for linux/unix and conio.h for windows.
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 Samsung Omnia Pro B7610 with Stock WM 6.1 ROM Blog: http://www.sumitbhardwaj.co.in/blog |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A) Calling function | rose tamang | Programming | 4 | 15-07-2008 01:20 PM |
| About C functions clrscr, delay. Cannot be found? | aditya.shevade | QnA (read only) | 6 | 25-01-2007 09:45 PM |
| incorrect MS-DOS function?? | rounit | Software Q&A | 9 | 12-01-2007 11:52 PM |
| PC function | citizen | Software Q&A | 5 | 09-12-2006 11:55 PM |
| PHP mail function | anilsmart | Internet & WWW | 11 | 29-10-2004 07:12 AM |