|
|
|
|
|
|
|
Print CharList and FreqList (parameters discussed later) |
|
|
|
|
|
|
|
|
FOR index going from 0 through length-1
Print charist[index], " occurred ", freqList[index], " time(s)" |
|
|
|
|
|
|
|
|
|
Because the Increment FreqList module is only one simple statement, it is coded directly in the main module. Let's look at the interfaces of the other functions. |
|
|
|
|
| Function | In | Out | Comments | | GetCharList | | charList
length | length will be last value of counter. | | ZeroFreqList | length | freqList | | | ScanList | charList
length
inputChar | found
index | If found is TRUE, index gives place found. | | Print | freqList
charList
length | | |
|
|
|
|
|
|
Remember that any variables in the Out column must be reference parameters. Those listed only in the In column, except for arrays, should be value parameters. Because C++ always passes arrays by reference, an array listed only in the In column should be declared as const in the formal parameter list. |
|
|
|
|
|