diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-12-03 20:18:00 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-12-03 20:18:00 -0500 |
commit | 5ceac644e90c929e77f05d357d1d35d45e673fac (patch) | |
tree | 18c76f6117942fa46391fbbd8bd24e2c759c4895 /docs/source/lang/assignment.rst | |
parent | e5b1e44a8ae8c593456f4b4734f05c9065f6f07b (diff) | |
download | librambutan-5ceac644e90c929e77f05d357d1d35d45e673fac.tar.gz librambutan-5ceac644e90c929e77f05d357d1d35d45e673fac.zip |
cleaning up previous commits.
note that addition of new files under docs/source/lang/api and
docs/source/lang/cpp which were just copies of files in
docs/source/lang/ imply that change history is lost to git.
Diffstat (limited to 'docs/source/lang/assignment.rst')
-rw-r--r-- | docs/source/lang/assignment.rst | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/docs/source/lang/assignment.rst b/docs/source/lang/assignment.rst deleted file mode 100644 index b6ad4d5..0000000 --- a/docs/source/lang/assignment.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. highlight:: cpp - -.. _lang-assignment: - -Assignment Operator (``=``) -=========================== - -Stores the value to the right of the equal sign in the variable to -the left of the equal sign. - -The single equal sign in the C++ programming language is called the -assignment operator. It has a different meaning than in algebra -class, where it indicated an equation or equality. The assignment -operator tells the microcontroller to evaluate whatever value or -expression is on the right side of the equal sign, and store it in -the variable to the left of the equal sign [#fgross]_. - - - -Example -------- - -:: - - int sensVal; // declare an integer variable named sensVal - senVal = analogRead(0); // store the (digitized) input voltage at analog pin 0 in SensVal - - - -Programming Tips ----------------- - -The variable on the left side of the assignment operator ( = sign ) -needs to be able to hold the value stored in it. If it is not large -enough to hold a value, the value stored in the variable will be -incorrect. - -Don't confuse the assignment operator [ = ] (single equal sign) -with the comparison operator [ == ] (double equal signs), which -evaluates whether two expressions are equal. - - -Arduino Compatibility ---------------------- - -Assignments on the Maple are identical to those on Arduino. - - - -See Also --------- - - -- `if (comparison operators) <http://arduino.cc/en/Reference/If>`_ -- `char <http://arduino.cc/en/Reference/Char>`_ -- `int <http://arduino.cc/en/Reference/Int>`_ -- `long <http://arduino.cc/en/Reference/Long>`_ - - -.. rubric:: Footnotes - -.. [#fgross] Experienced C++ programmers know this to be an - oversimplification of what happens when the variable on the left - hand side is an object. See Richard Gillam's wonderful and scary - `The Anatomy of the Assignment Operator - <http://icu-project.org/docs/papers/cpp_report/the_anatomy_of_the_assignment_operator.html>`_ - for more information. - - -.. include:: cc-attribution.txt |