[WEBINAR] Application Acceleration: Faster Performance for End Users

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

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
"Techopedia" on Twitter

Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
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.