Let's move on to another kind of C program statement: assignment statements. Once a variable has been declared, it can be given a value by an assignment statement. You should already be familiar with the concept of assignment from the Maple lessons, so we'll go through this quickly.
To assign a value to a variable in Maple, you use the ``:='' operator like this:
Digits := 10;
In C, the assignment operator is ``='' instead. For example, the C statement:
ankle_x = 0.0;
assigns the (floating point) value zero to the (floating point) variable ankle_x. Go through the program and locate all of the assignment statements.
Remember that assignment is not the same thing as equality or definition. For example, consider the following C statement:
count = count + 1;
As an algebraic equation, that statement is nonsense. If you tried to solve it for the value of COUNT, there would be no solution to the equation. But assignment statements are not algebraic equations. What does the above statement really do in a C program?
Click here for the answer.