May 2002
Beginner
320 pages
6h 18m
English
The only difference that results from calling the functions in the new modules is the need to qualify function names with their namespace. Listing 8.5 shows the new main.cpp.
1: #include <iostream> 2: *3: #include "PromptModule.h" *4: #include "ErrorHandlingModule.h" 5: 6: using namespace std; 7: 8: float GetDividend(void) 9: { 10: float Dividend = 0; 11: 12: cout << "Dividend: "; 13: cin >> Dividend; 14: 15: return Dividend; 16: } 17: 18: float GetDivisor(void) 19: { 20: float Divisor = 1; 21: 22: cout << "Divisor: "; 23: cin >> Divisor; 24: 25: return Divisor; 26: } 27: 28: float Divide 29: (const float theDividend,const float theDivisor) 30: { 31: return (theDividend/theDivisor); ... |
Read now
Unlock full access