← BYTES
C++·Starter·Ref: 8.1.12

What is a namespace used for in C++?

Have a question about this video? Mention reference 8.1.12 when you contact us.

a.To allocate memory for objects
b.To define a new primitive data type
c.To group related names (classes, functions, variables) together and avoid naming collisions between different parts of a program or different libraries
d.To mark a function as inline
A namespace (e.g. `namespace mylib { ... }`) scopes a set of identifiers under a common prefix, so two libraries can each define a function called `process()` without clashing, as long as they're in different namespaces.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES8112#C