Abstract
The assignment operator = assigns a value to a variable / object:
int main() { char mychar = 'c'; // define a char variable mychar mychar = 'd'; // assign a new value to mychar int x = 123; // define an integer variable x x = 456; // assign a new value to x int y = 789; // define a new integer variable y y = x; // assing a value of x to it }
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Slobodan Dmitrović
About this chapter
Cite this chapter
Dmitrović, S. (2020). Operators. In: Modern C++ for Absolute Beginners. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6047-0_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-6047-0_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-6046-3
Online ISBN: 978-1-4842-6047-0
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books