Object oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
In OOP, computer programs are designed by making them out of objects that interact with one another.
In addition to classes and objects, there are four major pillars in OOP:
Overall, object oriented programming makes it easier to develop the program. Furthermore, it provides data security, maintainability and code reusability.
Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection (if/then/else) and repetition (while and for), block structures, and subroutines.
Structured Programming divides a program into a set of functions or modules which have statements embraced inside curly braces and each of them perfom a subtask. Usually, as each function represents a specific functionality, it is easier for the programmer to test and debug the code, but this can differ depending on the program.
In the structured programming C, the user can create his own user-defined functions. The main function calls the other functions and indicates the execution of the program. When there is a function call, the control is passed to that function. After completing the function, the control passes back to the main program. Moreover, a variable inside a function is a local variable, and global variables are accessible by all the functions.
Structured programming is a programming paradigm which divides the code into modules or function, while OOP is a programming paradigm based on the concept of objects, which contain data in the form of fields known as attributes, and code in the form of procedures known as methods.
Structured programming focuses on dividing the program into a set of functions in which each function works as a subprogram while object oriented programming focuses on representing a program using a set of objects which encapsulates data and object.
It is easier to modify the Object Oriented programs than structured programs.
In structured programming, the main method communicates with the functions by calling those functions in the main program whereas, in object oriented programming, the objects communicate with each other by passing messages. Hence, this is an important difference between structured and object oriented programming.
There are no access specifiers in structured programming while there are access specifiers such as private, public and protected in Object Oriented Programming. Thus, this is also an important difference between structured and object oriented programming.
Data is not secure in structured programming, but it is secure in object oriented programming.
It is easier to reuse code in object oriented programming than in structured porgramming.