Unit-5 Name space- OOPs using C and C++ | BCA 3rd semester
Unit-5 Name space- OOPs using C and C++ | BCA 3rd semester-Hello student Welcome to the pencilchampions.com website. This website provide Unit-5 Object oriented Programming in Using C and C++. This website helpful for all courses student . Thankyou for visiting pencilchampions.com.Â
Unit-5
Namespace
- In C++, namespace is also used to organize- multiple classes so that it is easy to handle the application to access the class of namespace we need to use namespace name, class name.
- We can use it using keywords so that we do not have to use the full name all the time.
External Link–https://drive.google.com/file/u/0/d/1nqo7v5lecndDEO2HdIl2Yzje1NPRpKNt/view?usp=sharing&pli=1
Exception Handling
- Exception handling in C++ is a process of handling time and run errors. We perform exceptions to handle normal application flow to maintain the application even after errors. All exception classes in (+t) are derived from std::exception class. Let’s see the list of C++ common exception classes.
- Logic Failure – This is an exception that can be detected by reading a code.
- Runtime Error- This is an exception that cannot be detected by reading any code.
- Bed Exception – It is used to resolve unexpected exception in C++ program.
Read More-https://pencilchampions.com/unit-4-member-function-oops-using-c-bca-2nd-year/
In C++ (++ handling keywords
- Â Exception handling we use handling. 3 keywords exception to execute
- Try
- Cots
- Throwing
- C++ try/catch- exception execute wing C++ try block handling f/catch statement to hold on is wild. Code that exception may occur.Â
- Try [] block – This captures the error message in any program at runtime and throws it into a catch block where the user can customize the error message.
Limitations of library functions
- As a programmer, we have no control over predefined functions. The implementation part is machine readable format.
- Whenever in the implementation any predefined function is not supporting the user
Necessary work
- Then go to User Defined
User-defined functionsÂ
- These functions.
- For example- Suppose you want to create a function to add two numbers then you create a function named Sum. This type goes for user defined functions.
Defining a Function
- Return Type – A value that a function can iterate over. A return type is a value that a function can iterate over. The return type parameter and return statement are optional.
- Function Name – Function declaration is the process of telling the compiler about what the function returns.
- Parameters – A paramotor is like a place holder. This value refers to the ordered type and number of parameters of a function. Parameters are optional i.e. a function can have a number of parameters.
- Function Body – The function body contains a collection of statements that define what the function does.
- Function Declaration – Function declaration tells the compiler about the function name and how to call the function. Syntax: return type functionName(parameter),
- Calling a function – When we call a function the control goes to function 55/73 and executes the entire code.
Discover more from Pencil Champions
Subscribe to get the latest posts sent to your email.