answersLogoWhite

0


Best Answer

The std namespace is the standard library, which includes many of the common data types, constants, structures, classes and functions that you will use to create C++ programs. There are very few non-trivial C++ programs that do no make use of at least some portion of the standard library at some point. Note that you need only include those portions you actually use; there is no need to include the entire standard library. Any built-in functions that require the standard library will include only as much as they need to, whether you yourself include those portions or not.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

This is known as an using directive.

When you write the using namespace std; directive in your program, you are informing the compiler you will be using all the names within the std namespace without qualification.

So instead of using the explicit names std::cin and std::cout, you can use the implicit names cin and cout instead. The calls themselves are no different, but your source code is a little easier to read.

You can also explicitly declare the names you will be using in a namespace (rather than all of them):

using std::cin;

using std::cout;

These are known as using declarations.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does the use namespace STD syntax do?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the use of using namespace STD in c plus plus programming?

No, the use of 'namespace std' is not compulsory. You can specifiy it on any object reference. Specifying 'namespace' simply provides a default value. Contrast ... using namespace std; cout << "Hello world!" << endl; ... with ... std::cout << "Hello world!" << std::endl;


In c plus plus Programming can you replace STDio header with using name space STD?

No. You can't use namespace std even if you include stdio.h. At the very least you must include stddef.h before you can use namespace std.


What are the basic syntax of c program?

You have to be more specific. What part of C syntax? Do you want the syntax for outputing a number or sentence, do you want to syntax for creating a array, struct, a user defined function or what? #include iostream using namespace std; int main { cout << "Hello World!" << endl; return 0; };


What is namespace in c plus plus program?

A namespace is similar to a class in object oriented programming. A namespace contains functions defined by the programmer. for example namespace std contains functions like cout and cin.namespaces can be globaly declared like so: "using namespace std;"which includes all the functions located in the namespace std.if you only need to use cout you can globaly declare only cout like this "using std::cout;"orstd::cout


In your program what if you do not provide the following directive in your code using namespacestd hint what will you need to do?

If you do not include the directive using namespace stdin your program, any references to objects in namespace std will need be be qualified with that namespace. For instance...cout


What is the syntax of printing a value in c plus plus?

std::cout<<42<<std::endl;


What is the C plus plus directive that allows you to refer to classes in a namespace like STD?

A quick and simple way to do this would be to add 'std::' directly in front of the data type that requires it. For example: a vector data type, without the line of code 'using namespace std' would look like this: 'std::vector' (without the inverted commas).


How do you limit the floating in C Plus Plus in output statement?

Use setprecision.Example:#include #include using namespace std; int main() { double f = 3.14159; cout


Why is namespace std used in c?

Namespaces in general help keep code organised and ultimately avoid polluting the global namespace. That is, multiple namespaces can use the same names for different purposes without causing name-clashes. A class, struct or union is also a namespace. The std namespace contains all standard library names, including standard template library names. The namespace is also subdivided to separate different features of the library. Although namespaces can make code less readable, you can import names into the global namespace to help simplify code without polluting the global namespace. This is achieved by importing names locally, within those functions and classes that specifically require those names. In trivial programs, it is common practice to import all standard library names into the global namespace but in real-world programs imports are highly localised.


How do you solve this error under-fined symbol 'cin'in c plus plus?

#include <iostream> using namespace std;


How do you write a program for printing the following outputs 12345678910?

using namespace std; #include <iostream> int main() { cout << "123456789012" << endl; }


What are the syntax of turbo c graphics function?

// my first string #include <iostream> #include <string> using namespace std; int main () { string mystring; mystring = "This is the initial string content"; cout << mystring << endl; mystring = "This is a different string content"; cout << mystring << endl; return 0; } This is the initial string content This is a different string content