473,473 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Clear Screen in C using Dev C++

1 New Member
Hi Guys,
Am using Windows 2000 and Dev C++ to create C programs. I'm trying to use clear screen and other graphic functions such as positioning output on screen. Have seen some documents that suggest i use curses.h or system("clear") for clear screen, for example but all this has failed.
Jan 10 '07 #1
8 64409
123Coder
1 New Member
Hi Guys,
Am using Windows 2000 and Dev C++ to create C programs. I'm trying to use clear screen and other graphic functions such as positioning output on screen. Have seen some documents that suggest i use curses.h or system("clear") for clear screen, for example but all this has failed.
You must use CONIO2.H header file to use clrscr(); You can get this from devpak.org in the text console category. Get the CONIO library. This will add the Borland Clrscr(); function as well as Dev Cpp's standard Conio.h header file.
Goodluck! =)
Jan 27 '07 #2
rdallas
2 New Member
You can use the following C statement to clear your screen:

Expand|Select|Wrap|Line Numbers
  1. system("sh -c clear");
You are executing the sh shell program (usually /bin/sh) and having it execute the built-in "clear" command. You need to use the "-c" option to tell sh that the next option is a built-in command, not a file to be executed. See the man page on sh for more info.
Sep 21 '07 #3
rdallas
2 New Member
The previous post assumes you are using Unix. On Windows, you can clear the screen by using the "cls" command; there is no "clear" command on Windows. I was able to use the following code to clear the screen (command window) using Borland C++ 5.5.1 for Win32 on Windows XP:

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. int main( int argc, char *argv[] )
  4. {
  5.     system("cls");
  6. }
Sep 21 '07 #4
vinay khurana
1 New Member
A lot of try to clear the sacreen in a program of c using dev c++ on OS 7,but never works
Feb 3 '12 #5
JazibBahir
2 New Member
Now use this

clrscr();
Feb 4 '12 #6
sanjoy adhikary
1 New Member
i want a code using programm
Apr 7 '14 #7
Deepak5218
1 New Member
Use system("cls") including the stdlib.h in the begining of the programm...

See the example......


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
main()
{
char name[10]="Deepak";
char pass[20]="Sharma";
char uname[10],upass[20];
printf("=======================LOGIN PANEL===========================\n");
printf("Username : ");
scanf("%s",uname);
printf("Password : ");
scanf("%s",upass);
system("cls");
if(strcmp(name,uname)||strcmp(pass,upass))
{
printf("\tACCESS DENIED\n\n");
printf("Enter a valid username and password...");
}
else
{

printf("\tACCESS GRANTED\n\n");
printf("Welcome %s, Happy to see you again :)",name);
}
getch();
}
Mar 4 '15 #8
riteshsuprchamp
1 New Member
please include stdlib.h file and then call system("cls") and enjoy.
#include<stdlib.h>

system("cls");
Sep 2 '15 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Peter | last post by:
I am just trying to learn python, to use for some fairly basic command line utilities which will run in either Windows/DOS or Linux. I cannot find a platform neutral way of manipulating the screen....
20
by: ritchie | last post by:
Hi, I am trying to clear the screen in my program. I am loking for something that will work on all compilers, especially Borland & MS Visual Studio 6. On Visual studio I used 'system("cls");'...
4
by: John | last post by:
Hi I have the following in a Perl script. I just want to "clear screen" but it does not work. I don't think I've got my client and server sides confused. Any ideas? <SCRIPT...
6
by: andrewanderson | last post by:
hi i would like to know what are the method to clear the comand window screen using visual c++ what are the codes to use? can anyone help me? i want to clear the screen once an input is entered...
0
by: sajithamol | last post by:
I have an Applet that has three buttons on it, one being a clear screen button. I have it setup right now so it draws a rectangle the size of the applet and fills it with the background color. But...
2
by: owl | last post by:
and here I thought I was going to finally be able to change the world AND contribute back to python with my amazing clear screen extension - but I can't get it to work. ;( Copying from...
9
by: pbd22 | last post by:
Hi. Does anybody know how to issue a clear screen command like DOS "cls" in a telnet session? Thanks!
5
by: Kid Programmer | last post by:
Hello guys. I was wondering how you can clear the screen in a java program. Here is the code for my program: import javax.swing.SwingUtilities; import javax.swing.JFrame; import...
1
by: sganeshsvk | last post by:
i want to clear the screen command prompt for mysql in windows XP... In linux we use (CTRL + L) for clear the screen in mysql prompt.... i already use this command ( \c ) then ( \! clear ) for...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
1
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.