Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 6th, 2008, 10:34 AM   #1
ChevyCowboy15
Newbie
 
ChevyCowboy15's Avatar
 
Join Date: Nov 2007
Location: Central USA
Posts: 17
Rep Power: 0 ChevyCowboy15 is on a distinguished road
clear the screen in linux

i am having a problem with clearing my screen on Linux...

i have been creating a small dumb program that does nothing but i am just trying to get practice programming and i have been using windows XP and i was using system("cls") to clear the screen
and now that i am back home and on my own computer i am programming on Linux and i couldnt get the program to compile because it came up with errors where ever i put the system("cls") and i also used the system("clear") but it also brought up errors

these are the errors:

login.cpp:22:10: warning: character constant too long for its type
login.cpp: In function ‘int main()’:
login.cpp:22: error: invalid conversion from ‘int’ to ‘const char*’
login.cpp:22: error: initializing argument 1 of ‘int system(const char*)’

am i using the wrong functions or am i missing something??

thanks for any help on this
ChevyCowboy15 is offline   Reply With Quote
Old Jun 6th, 2008, 4:06 PM   #2
nigel
Newbie
 
nigel's Avatar
 
Join Date: Apr 2008
Posts: 10
Rep Power: 0 nigel is on a distinguished road
Re: Some Beginner Questions

Quote:
Originally Posted by ChevyCowboy15 View Post
these are the errors:

login.cpp:22:10: warning: character constant too long for its type
login.cpp: In function ‘int main()’:
login.cpp:22: error: invalid conversion from ‘int’ to ‘const char*’
login.cpp:22: error: initializing argument 1 of ‘int system(const char*)’

am i using the wrong functions or am i missing something??

thanks for any help on this
Please post the code to this program so we can look for the errors.
nigel is offline   Reply With Quote
Old Jun 6th, 2008, 6:06 PM   #3
Sorrofix
Expert Bug Developer
 
Sorrofix's Avatar
 
Join Date: Apr 2008
Posts: 21
Rep Power: 0 Sorrofix is on a distinguished road
Re: clear the screen in linux

Naturally, you'll have to post your code if you want any kind of help with your it. Our psychological powers have been lacking lately.

By the way, I'd like to throw in that I highly recommend against clearing the screen. Here are some reasons why:
http://www.daniweb.com/forums/post66701-7.html
Sorrofix is offline   Reply With Quote
Old Jun 6th, 2008, 7:02 PM   #4
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 255
Rep Power: 1 Jabo is on a distinguished road
Re: clear the screen in linux

I thought programmers were anti-social by default...
Jabo is offline   Reply With Quote
Old Jun 19th, 2008, 8:58 PM   #5
ChevyCowboy15
Newbie
 
ChevyCowboy15's Avatar
 
Join Date: Nov 2007
Location: Central USA
Posts: 17
Rep Power: 0 ChevyCowboy15 is on a distinguished road
Re: clear the screen in linux

can anyone tell me the command for clearing the screen in linux?
i tried

system("cls")

system("ckear")

neither one of those works
ChevyCowboy15 is offline   Reply With Quote
Old Jun 19th, 2008, 9:18 PM   #6
nigel
Newbie
 
nigel's Avatar
 
Join Date: Apr 2008
Posts: 10
Rep Power: 0 nigel is on a distinguished road
Re: clear the screen in linux

Why don't you post the goddamn code? And the latter should work, assuming you meant "clear".
nigel is offline   Reply With Quote
Old Jun 19th, 2008, 10:07 PM   #7
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 530
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: clear the screen in linux

Quote:
Originally Posted by ChevyCowboy15 View Post
can anyone tell me the command for clearing the screen in linux?
i tried

system("cls")

system("ckear")

neither one of those works
You do it the same way that you would do it from the command shell. There is no such shell command as "ckear".

Another way is to use curses library for screen output.

Third way is to use vt100 api calls.

Fourth way is to use termcap function calls.

Fifth way is to print a bunch of '\n' characters.
__________________
I Like Ike. Vote for Dwight Eisenhower this November.
--This message brought to you by the the Procrastinators Club Of America.
Ancient Dragon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I clear the screen? crawforddavid2006 Java 24 Apr 1st, 2008 3:44 AM
Clear screen with Java Eric the Red Java 9 Feb 22nd, 2006 10:28 PM
How to clear the screen ?? Gunman Python 7 Oct 24th, 2005 9:51 PM
Clear screen chungchung C 10 Oct 13th, 2005 8:07 PM
Clear Screen in Java Dark Flare Knight Java 3 Jun 24th, 2005 12:09 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC