May 2002
Beginner
320 pages
6h 18m
English
The Tape() function is fairly simple, and is coded in main.cpp.
1: void Tape(const char theOperator,const float theOperand) 2: { 3: static const int myTapeSize = 20; // Array size 4: 5: static char myOperator[myTapeSize]; // Operator part 6: static float myOperand[myTapeSize]; // Operand part 7: 8: static int myNumberOfEntries = 0; // What's in tape now 9: 10: // Remember that arrays start with element 0 11: // And that the highest element is the size - 1; 12: 13: if (theOperator != '?') // Add to the tape 14: { 15: if (myNumberOfEntries < myTapeSize) // We have room 16: { 17: myOperator[myNumberOfEntries] = theOperator; 18: myOperand[myNumberOfEntries] = theOperand; 19: myNumberOfEntries++; 20: } 21: ... |
Read now
Unlock full access