473,545 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

screen clearing in ANSI C

Hi everyone!
Does anyone know, if it is possible to clear the screen in ANSI C?
If it is,then how?
Any help would be appreciated.

Laszlo Kis-Adam
<dfighter_AT-NOSPAM_freemail .hu
Nov 24 '06 #1
65 8546
Leslie Kis-Adam wrote:
Hi everyone!
Does anyone know, if it is possible to clear the screen in ANSI C?
No, "screens" are platform specific and may not even exist in many.

--
Ian Collins.
Nov 24 '06 #2

Leslie Kis-Adam wrote:
Hi everyone!
Does anyone know, if it is possible to clear the screen in ANSI C?
If it is,then how?
Any help would be appreciated.

Laszlo Kis-Adam
<dfighter_AT-NOSPAM_freemail .hu
printf(" \033[2J");

should do the work, it's an ansi code for clear screen

Nov 24 '06 #3
st******@gmail. com said:
>
Leslie Kis-Adam wrote:
>Hi everyone!
Does anyone know, if it is possible to clear the screen in ANSI C?
If it is,then how?
Any help would be appreciated.

Laszlo Kis-Adam
<dfighter_AT-NOSPAM_freemail .hu

printf(" \033[2J");

should do the work, it's an ansi code for clear screen
I wrapped it up in a main and ran it on my Linux box, but the screen didn't
clear. Not even the terminal window cleared.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 24 '06 #4
If I'm not wrong, the simplest method of clearing the screen would be
to use a syntax as shown below
{
..
..
..
system("cls");
..
..
..
}

This syntax is what I have been using over the years, however, you have
to find the proper spot to place this syntax.

kind regards,
Gurdip Singh.
gu****@hackinth ebox.org || gu************* @gmail.com

Nov 24 '06 #5
gurdz wrote:
If I'm not wrong, the simplest method of clearing the screen would be
to use a syntax as shown below
{
system("cls");
Platform (windows?) specific.

--
Ian Collins.
Nov 24 '06 #6
In article <11************ **********@m7g2 000cwm.googlegr oups.com>,
gurdz <gu************ *@gmail.comwrot e:
>If I'm not wrong, the simplest method of clearing the screen would be
to use a syntax as shown below
>system("cls" );
I tried that, but unfortunately the "cls" command on my system means
"clear local storage", and it reformatted all my disks.

-- Richard
--
"Considerat ion shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Nov 24 '06 #7
"Leslie Kis-Adam" writes:
Does anyone know, if it is possible to clear the screen in ANSI C?
If it is,then how?
A for loop containing about 60 '\n's would clear most, but not all,
screens.
Nov 24 '06 #8
gurdz wrote:
If I'm not wrong, the simplest method of clearing the screen would be
to use a syntax as shown below
{
..
..
..
system("cls");
..
..
..
}

This syntax is what I have been using over the years, however, you have
to find the proper spot to place this syntax.
Hmm, when I run the following program, it outputs:
"sh: line 1: cls: command not found"

#include <stdlib.h>

int main()
{
system("cls");
return 0;
}
--
Clark S. Cox III
cl*******@gmail .com
Nov 25 '06 #9
>Hi everyone!
>Does anyone know, if it is possible to clear the screen in ANSI C?
If it is,then how?
Where is the screen on my ASR33 teletype? Or do you mean the metal
screen that keeps flies from getting sucked into the fan on the back of
the CPU unit? For that one, you power down the CPU, remove the screen,
and blast it with a stream of water from a hose to wash the flies off.
Nov 25 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4522
by: Curious Student | last post by:
I was looking at methods of clearing the screen. I remember using clrscr() in C on a Unix machine when I was at the institute learning software development. I tried using it on MS VC++ 6.0. It didn't work. I looked up the documentation. The documentation said this is a non-standard function and is included in conio.h. I had included conio.h...
51
3879
by: someone | last post by:
I was just wondering if there is any way of editing anything already printed on the screen with out using the system("cls") command.
11
5332
by: Rajendran | last post by:
I just want to clear the above three lines from the current position, so that I can start printing my results from that point. In short I want to clear a portion of my screen. Note: I work in the UNIX environment using gcc compiler. And I'm not a super user. I want a "simple solution". I tried the combination of "\r\b" escape...
0
7660
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7813
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7431
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7761
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5976
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3457
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1888
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.