You posted the assignment, now tell us what question you have ???
>>int fnGenerateTelNumber(char cTelephone_Num)
That only declares a single character, not an array of characters. You have to
declare it like this: int fnGenerateTelNumber(char cTelephone_Num[]) or any of its other variants:
int fnGenerateTelNumber(char* cTelephone_Num)
int fnGenerateTelNumber(char cTelephone_Num[7])
When you declare the array in main() make sure you include space to hold the null-terminating character. If you want a 7-digit telephone number then the charcter array must be at least 8 bytes.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
We know the requirements - you posted them in your original post.
Exactly what is it that you don't understand? If your compiler is producing errors, what are they? BTW the function prototype for fnTelephone_Num() is no longer consistent with the actual function. The parameters have to be identical.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341