473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to clear screen in visual c++

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
example
once the name is keyed in it clears the screen and proceed to the next question.

this way can make the whole program neater and easier to look at.

thanks in advance!!
Feb 24 '07 #1
6 15622
sicarie
4,677 Expert Mod 4TB
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
example
once the name is keyed in it clears the screen and proceed to the next question.

this way can make the whole program neater and easier to look at.

thanks in advance!!
There are several different ways to do this, from using the system command to using different libraries.

How "standard" do you want this program to be? (ie - are you using conio.h?)
Feb 24 '07 #2
There are several different ways to do this, from using the system command to using different libraries.

How "standard" do you want this program to be? (ie - are you using conio.h?)
hi thanks for replying,

i've tried using void but its not clear screen its just space which makes it cool but not neat what is conio.h how do i use it can u give me an example how it works or any other way is easier?

thanks in advance
Feb 25 '07 #3
sicarie
4,677 Expert Mod 4TB
hi thanks for replying,

i've tried using void but its not clear screen its just space which makes it cool but not neat what is conio.h how do i use it can u give me an example how it works or any other way is easier?

thanks in advance
I'm not too sure if there is an implementation in conio.h - I was just curious as to how portable you wanted the program to be - a call using the 'system' command will take whatever your operating system's clear command happens to be, but will then not be portable to another type of OS.

Check out 'system()' and (I'm assuming you're using windows) try to google 'dos clear screen command'.
Feb 25 '07 #4
eunice
1
hi, i tried conio.h then tried system("cls"); this doesn't work.... then tried also the stdlib.h but still not useful... kindly advice..

thanks,
eunice =)
Mar 21 '07 #5
sicarie
4,677 Expert Mod 4TB
hi, i tried conio.h then tried system("cls"); this doesn't work.... then tried also the stdlib.h but still not useful... kindly advice..

thanks,
eunice =)
This is also operating system dependent - if you're on XP and running through command line, 'cls' should work, if you're using conio, there is another option available in there (I believe), and if you're in Linux, it's just 'clear'.
Mar 21 '07 #6
hi, i tried conio.h then tried system("cls"); this doesn't work.... then tried also the stdlib.h but still not useful... kindly advice..

thanks,
eunice =)

hey try putting this #include <cstdlib> at the top of your program then use system("cls") and that should work
Mar 24 '07 #7

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

Similar topics

19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
6
by: jcollins | last post by:
Is there a command in Python to clear the screen? That is without writing multiple blank lines. Thanks. Jim C
18
by: Tim Mierzejewski | last post by:
How do I clear the text from my screen, other than a bunch of \n's or endl's? Tim M.
6
by: KL | last post by:
I was thinking...not always a good thing...is there a way to clear your screen. Like my current program asks a question and then posts 6 possible answers to choose from. Once a valid answer is...
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");'...
11
by: sebplays | last post by:
Hi, I seach function for clear screen in VB.Net for console application. Please help me
22
by: mp | last post by:
i have a python program which attempts to call 'cls' but fails: sh: line 1: cls: command not found i tried creating an alias from cls to clear in .profile, .cshrc, and /etc/profile, but none...
2
by: nickyeng | last post by:
i have a function that clear the screen and then display array to cout. i compiled no error no warning, i run it, the screen really get "clear" but it does not display anything to cout, and it...
6
by: Alexander Vasilevsky | last post by:
How to clear the screen in the console application in Microsoft Visual C #. NET 2003. http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas discount
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.