Review of C/C++

  • Unique Paper ID: 142917
  • Volume: 2
  • Issue: 7
  • PageNo: 158-159
  • Abstract:
  • This approach doesn't always work on large programs in the real world, because these programs evolve as a result of new requirements or constraints. A modification to a program commonly requires a change in one or more of its data structures. For instance, a new field might be added to a personnel record to keep track of more information about each individual; an array might be replaced by a linked structure to improve the program's efficiency; or a bit field might be changed in the process of moving the program to another computer. You don't want such a change to require rewriting every procedure that uses the changed structure. Thus, it is useful to separate the use of a data structure from the details of its implementation. This is the principle underlying the use of abstract data types. Here are some examples. • stack: operations are "push an item onto the stack", "pop an item from the stack", "ask if the stack is empty"; implementation may be as array or linked list or whatever. • queue: operations are "add to the end of the queue", "delete from the beginning of the queue", "ask if the queue is empty"; implementation may be as array or linked list or heap. There are two views of an abstract data type in a procedural language like C. One is the view that the rest of the program needs to see: the names of the routines for operations on the data structure, and of the instances of that data type. The other is the view of how the data type and its operations are implemented. C makes it relatively simple to hide the implementation view from the rest of the program.
email to a friend

Cite This Article

  • ISSN: 2349-6002
  • Volume: 2
  • Issue: 7
  • PageNo: 158-159

Review of C/C++

Related Articles