Structured Programming

C is called a structured programming language because to solve a large problem, C programming language divides the problem into smaller modules called functions or procedures each of which handles a particular responsibility. The program which solves the entire problem is a collection of such functions.

Here is an example of Matrix addition program, which is divided into these sub procedures - input matrix, display matrix, add matrix, save result matrix to file. Here is a pictorial structural view of the program.

Matrix addition example

Another good example is calculate student's grade. Program is divided into these sub modules - input student marks, get student record, update student record, display student record, calculate grade. Here is a structural view of the program.

student grade example

One major drawback of C language is that similar functions cannot be grouped inside a module or class. Also functions cannot be associated to a type or structure. Thus data and functions cannot be bound together. C++ language overcomes these problems by introducing object oriented functionality in its programming capabilities.

Advantages

  • C structured programming is simple and easy to understand and implement.
  • It is well sited for small size implementation. However this is not restricted. A good design can extend it to large size implementation.
  • Programmers do not require to know complex design concepts to start a new program.

Disadvantages

  • Data and methods and not be bind together in a module.
  • Polymorphism and inheritance are not available.
  • Complex design and full object oriented design cannot be implemented.
  • Programmers generally prefer object oriented programming language over structured programming language when implementing a complex gaming applications or front end business applications.

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

 Vote 1

Similar topics related to this section

first C program, header files, library, compilation, pre-processing, compilation, optimization, linking format, debugging with GDB, structured programming language, data types, storage classes, volatile variable,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan