Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
44 views1 page

Programming Fundamentals: Assignment NO # 1

The document discusses two programming fundamentals: using namespaces to avoid naming collisions when using the C++ standard library, and the const keyword which specifies that a variable's value cannot be modified. It notes that the entire standard library is within the std namespace, and using declarations are needed to access types and functions from it. For const, it explains that this specifies an object or variable is constant and cannot be modified by the programmer, and can be used for both local and global constant declarations.

Uploaded by

Hassan Javed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views1 page

Programming Fundamentals: Assignment NO # 1

The document discusses two programming fundamentals: using namespaces to avoid naming collisions when using the C++ standard library, and the const keyword which specifies that a variable's value cannot be modified. It notes that the entire standard library is within the std namespace, and using declarations are needed to access types and functions from it. For const, it explains that this specifies an object or variable is constant and cannot be modified by the programmer, and can be used for both local and global constant declarations.

Uploaded by

Hassan Javed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming Fundamentals

Assignment NO # 1

Title: “Using namespace std” and “Const” role in Programming

Using Namespace std:

Namespace in C++ are most often used to avoid naming collisions i.e. (Namespace is used to

differentiate between standard identifiers and user built in functions).The entire C++ standard library is

defined within namespace STD. In order to use these types or functions, one must do these things put a

kind of using-declaration in your source (either using namespace std ; or i.e. using std::string

std::string, std::cout ;) This approach works well for individual source files, but should not be used

in a global context, like header files.

Const:

The const keyword specifies that a variable's value is (constant) i.e. Global and Local constant, and tells

the compiler to prevent the programmer from modifying it. When modifying a data declaration, the

const keyword specifies that the object or variable is not modifiable. i.e. (const int i = 5 ;), this can be

defined locally inside the program and also outside the program as a global variable.

You might also like