answersLogoWhite

0

What is naming space in c plus plus?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

A namespace is a group of related identifiers.

namespace ns {
int i;
double d;

}


Inside namespace ns, i and d can be used normally. Outside namespace ns, i is called ns::i and d is called ns::d. To import i into the current scope, say "using ns::i;". To import all identifiers in ns into the current scope, say "using namespace ns;". Namespaces can be nested:

namespace ns1 {
namespace ns2 {
int i;

}
int i;

}


The i in namespace ns1 is fully qualified as ns1::i. The i in namespace ns2 is fully qualified as ns1::ns2::i. The two variables are distinct. Inside ns2, i refers to ns1::ns2::i; inside ns1, i refers to ns1::i.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is naming space in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many letters of the alphabet are used in naming the line and space of a staff?

Seven (A, B, C, D, E, F and G).


How do you make a diamond using for loop in C plus plus?

Here is the code to do it: #include<stdio.h> main() { int n, c, k, space = 1; //Here we ask for the number of rows would be : printf("Enter number of rows\n"); scanf("%d",&n); space = n - 1; //This is the first half of the diamond for ( k = 1 ; k <= n ; k++ ) { for ( c = 1 ; c <= space ; c++ ) printf(" "); space--; for ( c = 1 ; c <= 2*k-1 ; c++) printf("*"); printf("\n"); } space = 1; //Here is the second half of the diamond for ( k = 1 ; k <= n - 1 ; k++ ) { for ( c = 1 ; c <= space; c++) printf(" "); space++; for ( c = 1 ; c <= 2*(n-k)-1 ; c++ ) printf("*"); printf("\n"); } return 0; } Hope that helped :)


What is meant by white spaces in c plus plus?

space, tabs (horizontal and vertical), carriage return, line feed, form feed.


What is b plus b plus b plus c plus c plus c plus c?

b+b+b+c+c+c+c =3b+4c


What is c plus c plus 2c plus c plus c equal?

c + c + 2c + c + c = 6c


B plus b plus b plus c plus c plus c plus c equals?

b + b + b + c + c + c + c = 3b + 4c


Symplify c plus c plus c plus c?

4c


What is c plus c plus c plus c plus c?

c + c + c + c + c = 5 * c.


Why you use small letter in c or c plus plus programming language?

I assume you mean using lower case letters. By convention, C and C++ standard libraries use lower-case naming conventions. This makes it easy to identify functions and types that belong to the standard library. When defining your own types, a leading capital is preferred. All capitals typically denotes a macro definition.


Primary and secondary key in c and c plus plus?

There are no "primary and secondary keys" in c and c plus plus.


What is c plus C plus C answer in algebra?

3c


What is the definition of storage space?

it is when your c drive is out of space it is when your c drive is out of space