Why we use std:: | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why we use std::

suppose after written int main () some times we are using std::<<"i <10",i++; in this case why we are using std:: I am not understand

19th Oct 2016, 2:12 AM
proud be to an iitian proud to ne indian also
proud be to an iitian proud to ne indian also - avatar
2 Answers
0
i am no good at english.it is a standara norm,if you use cout or cin,you should write std,and we of declare std in the program begain to simplify the program
19th Oct 2016, 5:15 AM
jacky
0
The std:: indicates that some names such as cout, cin and endl are part of the *namespace* std, which is defined by the standard library. The <iostream> header is part of the standard library; for this reason, we refer to cout as std::cout, which is the standard output stream. Now, the namespace is primarily used to distinguish potential names that are essentially the same. For instance, in a program that uses library A and library B, library A contains a name X, and library B also happens to contain a name X. To refer to X from library A, we want to use A::X to distinguish it from X from library B, which is referred to as B::X.
19th Oct 2016, 5:54 AM
Yu Xiang Zhang
Yu Xiang Zhang - avatar