Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

C Clear screen?

Original Message
Name: Blasterman
Date: November 20, 2007 at 19:06:52 Pacific
Subject: C Clear screen?
OS: Check my sig.
CPU/Ram: More than one computer th
Model/Manufacturer: More than one computer th
Comment:
Is there a universal terminal clear function in C? I'm using Windows XP, but I need this function to work with *nix systems as well.

All the OSes I use:
Windows XP, Windows 98, MS-DOS 6.22, OpenBSD 2.6, DLX Linux. I have 4 computers, one of which is emulated.


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: November 21, 2007 at 00:29:34 Pacific
Subject: C Clear screen?
Reply: (edit)
I do believe it's OS dependent. Sorry.


Report Offensive Follow Up For Removal

Response Number 2
Name: IVO
Date: November 21, 2007 at 04:32:04 Pacific
Subject: C Clear screen?
Reply: (edit)
You may try (#include <stdlib.h>)

if (system("cls")) system("clear");

That works under Win/DOS (either 9X/NT) and Linux/Unix.


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: November 21, 2007 at 04:55:03 Pacific
Subject: C Clear screen?
Reply: (edit)
Well, I'd use 'tput clear' (it's been around longer, I think) for the *nix, but yeah, that might be the best way to do it.

Report Offensive Follow Up For Removal

Response Number 4
Name: cup
Date: November 26, 2007 at 12:34:28 Pacific
Subject: C Clear screen?
Reply: (edit)
Unix - if it is an ANSI terminal, \033[2J will clear the screen.

On Windows 9x/ME, if ANSI.sys is loaded, \033[2J will work.

On Windows NT/2K/XP, have a look at http://msdn2.microsoft.com/en-us/li...


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: C Clear screen?

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




CPU and Graphics Upgrade Questions

VIRUS ALERT in Taskbar, HELP!

DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC