Chapter 1 Introduction 9
Variables 9
Data types 9
System defined data types (Primitive data types) 10
User defined data types 10
Data Structure 10
Abstract Data Types (ADT’s) 11
Memory and Variables 11
Size of a Variable 12
Address of a Variable 12
Pointers 13
Declaration of Pointers 13
Pointers Usage 13
Pointer Manipulation 14
Arrays and Pointers 15
Dynamic Memory Allocation 15
Function Pointers 16
Parameter Passing Techniques 16
Actual and Formal Parameters 16
Semantics of Parameter Passing 17
Language Support for Parameter Passing Techniques 17
Pass by Value 17
Pass by Result 18
Pass by Value-Result 19
Pass by Reference (aliasing) 20
Pass by Name 21
Binding 22
Binding Times 22
Static Binding (Early binding) 22
Dynamic Binding (Late binding) 23
Scope 23
Static Scope 23
Dynamic Scope 24
Storage Classes 25
Auto Storage Class 25
Extern storage class 26
Register Storage Class 31
Static Storage Class 31
Storage Organization 32
Static Segment 32
Stack Segment 33
Heap Segment 35
Shallow Copy versus Deep Copy 36
5. Table of Contents
Chapter 1 Introduction ............................................................................................................... 9
Variables ................................................................................................................................................... 9
Data types ................................................................................................................................................. 9
System defined data types (Primitive data types) ............................................................................ 10
User defined data types...................................................................................................................... 10
Data Structure ........................................................................................................................................ 10
Abstract Data Types (ADT’s) ................................................................................................................. 11
Memory and Variables .......................................................................................................................... 11
Size of a Variable................................................................................................................................ 12
Address of a Variable ......................................................................................................................... 12
Pointers................................................................................................................................................... 13
Declaration of Pointers ...................................................................................................................... 13
Pointers Usage .................................................................................................................................... 13
Pointer Manipulation ........................................................................................................................ 14
Arrays and Pointers ........................................................................................................................... 15
Dynamic Memory Allocation............................................................................................................ 15
Function Pointers............................................................................................................................... 16
Parameter Passing Techniques .............................................................................................................. 16
Actual and Formal Parameters .......................................................................................................... 16
Semantics of Parameter Passing ........................................................................................................ 17
Language Support for Parameter Passing Techniques ..................................................................... 17
Pass by Value...................................................................................................................................... 17
Pass by Result ..................................................................................................................................... 18
Pass by Value-Result.......................................................................................................................... 19
Pass by Reference (aliasing) .............................................................................................................. 20
Pass by Name...................................................................................................................................... 21
Binding ................................................................................................................................................... 22
Binding Times .................................................................................................................................... 22
Static Binding (Early binding) ........................................................................................................... 22