Created: 2023-01-10 15:37
Status: #concept
Subject: Programming
Tags: C Lvalue Expression
Variable
They are containers for data values, with their own Memory Addresses.
- they are sometimes referred to as Lvalues since Rvalues are assigned
=
to themLval = Rval
.
The Attributes Include:
- name
- value
- address
- C Data Type
There are Scalar Variables and Aggregate Variables.
Programming
- they are used to store data temporarily during program execution - to do calculations before producing an output.
- they have different C Data Type with corresponding byte sizes in order to be allocated using memory.
- A named variable becomes a unique Identifier during program execution and cannot reuse the same name again.
- We can assign Constants or Expressions to variables.
We normally have to Initialize variables in order to avoid errors.
References
- C Programming, A Modern Approach, 2nd Edition, Chapter 2.4