473,796 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does the system("cls") do?

3 New Member
I'm beginner at c++. I wanted to know what does the following code mean?

Expand|Select|Wrap|Line Numbers
  1. (system("cls");) 
thanks
Oct 6 '06 #1
2 139415
Banfa
9,065 Recognized Expert Moderator Expert
system()

is a call to the OS command line, "cls" is a command on some operating systems that clears the screen.

In my opinion use of the system() function should be avoided, it doesn't really add anything to the operation of the program that can't be done other ways or just shouldn't be done and does make the program very non-portable.
Oct 6 '06 #2
anushhprabu
43 New Member
im beginner at c++ i wanted to know what does (system("cls");) means ??
thanks
system() is used to run the DOS commands from the C, C++.. cls is the clear screen command (DOS cmd)..
similarly you can use system("dir");

or

char s="cd bin";
system (cd);
Oct 6 '06 #3

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

Similar topics

5
2505
by: could ildg | last post by:
As there is already __init__, why need a __new__? What can __new__ give us while __init__ can't? In what situations we should use __new__? And in what situations we must use __new__? Can __new__ take the place of __init__? Thanks.
7
1382
by: newseater | last post by:
Hello. I need to be able to control how objects are created. Sometimes when creating an object, i want to reuse another object instead. I've searched for factory method implementations and singleton implementations. They were too much of a hack! My first attempt of doing this was to play around with the __new__() method. But i didn't quite succed. Then i came up with making a static method which can create my instances or re-use other...
7
2022
by: ~neil~ | last post by:
hello I'm fairly new to the language, and my problem is I'm trying to write a program to run a command from the DOS prompt "C:>". I don't know all the functions in "C", however there are a few under the header file "process.h" that could be used, but I'm not really sure what they mean. I only know them by their name <prototype declaration>. I don't understand the arguments that are passed down to these functions, is why I'm seeking help...
1
4294
by: Ray | last post by:
Hello, I'm reading Mr. Flanagan's JS Definitive Guide 5th edition. I was wondering about a point he make in section 10.2 of the book: "Importing Symbols from Namespaces". He mentions in there that one can create an alias for the symbol defined in a namespace like this: // This is an easier name, to save typing.
23
4870
by: mahesh | last post by:
Hi all, I have following code that is supposed to increase the power by specified value. int main() { system("cls"); int i, exponent; double base; double new_base=0.0;
9
27477
AmberJain
by: AmberJain | last post by:
Hello, What is the difference between --------> 1. clrscr(); // defined in various header files 2. system("cls"); //available in stdio.h in bloodshed dev c++ Well, if there are no differences, then can we use them interchangebly?
2
1364
by: imho | last post by:
Hi all. I just send this post as a comment to the third part of Michele Simionato's article about metaprogramming techniques at: http://www.ibm.com/developerworks/linux/library/l-pymeta3.html?S_TACT=105AGX03&S_CMP=ART I found extremely useful the classinitializer "trick". I was thinking over the caveat not to call a class initializer after the _metaclass_ hook (an exception being raised in that case).
1
8657
by: xiaolim | last post by:
hi as shown in the source, i wanted to return to 'choice' in the 'switch' statement so that user can input their choices again after they chose the option. #include <iostream> #include <string> #include <fstream> #include <conio.h> #define MAX_STUDENT 100
5
14576
by: akonsu | last post by:
hello, i need to add properties to instances dynamically during run time. this is because their names are determined by the database contents. so far i found a way to add methods on demand: class A(object) : def __getattr__(self, name) : if name == 'test' : def f() : return 'test'
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4119
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
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.