Unit 4 Set 1
Unit 4 Set 1
PROGRAMMING LANGUAGE
15 FO
R TE
EN
BY TUS
HIKA R
AWAT
UNIT -4
SET-1
doubt solving
For updates for lectures community for notes profile building
Namespace
Namespace is used to define a scope where identifiers like variables ,functions
,classes etc are declared.
Main purpose of using a namespace is to prevent ambiguity that may occur
when two idedntifiers have same name.
It’s definition is similar to class definition ,the only difference s it doesn’t end
with a semicolon like class does.
There can be unnamed namespace too.
A namespace definition can be continued and extended over multiple files,
they do not be overriden or redefined.
Using scope resolution
operator
The using directive: using declaration:
Using keyword allows you to input an entire we import 1 specific name at a time ,which is
namespace into your program with global space available inside the current scope.
Object Persistance
fstream = > supports for simultaneous i/p & o/p operations on files
ifstream =>provides i/p operations on files (read data)
ofstream =>provides o/p operations on files (write data)
writing to a file
We use stream insertion operator(<<) only differernce is we use ofstream or
fstream object instead of cout object
Process of
converting system
error message into
user friendly error
message is known as
exception handling
It is an event which occurs
during execution of
program,that disrupts the
normal flow of the program.
Exception Handling mechanism
Syntax:
Try block is intended to throw exception which is
followed by catch block,only 1 try block.
output:
char exception caught
End of program
FFT
15 FOR TEEN
NEW VIDEOS
EVERY WEEK
Chapter-2
Chapter-2
FFT
15 FOR TEEN
doubt solving
For updates for lectures community for notes profile building
Visist
Channel
For More
Subjects
Check Out