

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An explanation of procedural programming and object-oriented programming paradigms, as well as the advantages and disadvantages of using pointers in c++. Procedural programming is based on the concept of calling procedures, while object-oriented programming is based on the concept of objects and their interactions. Pointers in c++ offer advantages such as direct memory access and reduced storage space, but also come with disadvantages like memory leaks and potential for memory corruption.
What you will learn
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Procedural Programming can be defined as a programming model which is derived from structured programming, based upon the concept of calling procedure. Procedures, also known as routines, subroutines or functions, simply consist of a series of computational steps to be carried out. During a program’s execution, any given procedure might be called at any point, including by other procedures or itself. Object Oriented Programming: Object oriented programming can be defined as a programming model which is based upon the concept of objects. Objects contain data in the form of attributes and code in the form of methods. In object oriented programming, computer programs are designed using the concept of objects that interact with real world. Object oriented programming languages are various but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types.
Pointers provide direct access to memory Pointers provide a way to return more than one value to the functions Reduces the storage space and complexity of the program Reduces the execution time of the program Provides an alternate way to access array elements Pointers can be used to pass information back and forth between the calling function and called function. Pointers allows us to perform dynamic memory allocation and deallocation.
Uninitialized pointers might cause segmentation fault. Dynamically allocated block needs to be freed explicitly. Otherwise, it would lead to memory leak. Pointers are slower than normal variables. If pointers are updated with incorrect values, it might lead to memory corruption.