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.