home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_12 / 704.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-12  |  687KB  |  2550x3300
Labels: book | reckoner | sky
OCR: 704 Chapter Discovering C++ The sum of the first four ements of an array This program consists of the function main() and two functions named sum() The parameters are different in both versions of sum so that the com- piler can select the correct function for each function call. Note that other than the fact that both functions have the same name no other special syntax necessary for overloaded functions Note 1: The prototype of the first version of sum() has two parameters: both parameters are of type doubl e The code for the function simply returns the sum of the two parameters Note 2 The prototype of the second version ofsum has two parameters also but this time the first parameter is an array of type int, and the second parameter has type int The code for the function returns the sum o ...