Cisco CloudCenter: Get the Hybrid IT Advantage

Assignment Operator

Definition - What does Assignment Operator mean?

An assignment operator, in the context of the C programming language, is a basic component denoted as "=". This operator assigns the values on the right-hand side of the operand to the left-hand side.

An assignment operator requires the value of expressions to be well defined and ensures that variables represent an entity that can be modified. Assignment operators also permit the same variable to hold different values at different stages of program execution. This makes assignment operators devoid of referential transparency, where procedures are supposed to return the same results for a particular set of inputs at a given time.

Techopedia explains Assignment Operator

Assignment operators are basic components of imperative programming such as C, where several values are associated with variable names at different stages of a program's execution. For instance, consider the code set:

int x=25;
double y;

In this set of statements, the variable "x" is initially assigned the value 25. Internally, a memory location is reserved for x, holding value 25. In the third statement, however, the same variable x is assigned another value. Therefore, an output of value x after the execution of all the three statements represents 50. At the machine level, assignment is executed using operations such as MOVE and STORE.

Assignment operators also allow chained assignment of values. For instance, the expression a=b=c=50, assigns the value 50 to a, b and c. This is referred to as chained assignment.

Assignment operators used along with binary operators are called compound assignment operators. They perform a binary operator operation on both operands and store the output of the operation in the left operand.

This definition was written in the context of C Programming Language
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.