Skip to main content

Value Model vs Reference Model

Value Model vs Reference Model


In programming languages, two different models are used for variables. 
These are: 

Value Model


 A variable contains a value. The name of the variable gives its value. 

Reference Model


A variable contains (say y) refers to another variable (say x) with a value. The variable ‘y’ is used to access the value of ‘x’ indirectly. 

The ‘C’ language is based on value model. However, by using pointers, we can implement the reference model. The pointer is used to access the value of a variable indirectly.

Comments