Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sunybcs!uhura.cc.rochester.edu!rochester!kodak!ektools!randolph From: randolph@ektools.UUCP (Gary L. Randolph) Newsgroups: comp.lang.c++ Subject: Re: Resolving an Overloaded Function Call Keywords: overloading Message-ID: <2619@ektools.UUCP> Date: 3 May 90 16:30:31 GMT References: <35925@think.Think.COM> Sender: randolph@ektools (Gary L. Randolph) Reply-To: randolph@ektools.UUCP (Gary L. Randolph) Distribution: usa Organization: Eastman Kodak, Dept. 47, Rochester NY Lines: 28 In article <35925@think.Think.COM> simons@think.com (Joshua Simons) writes: # # I have a question about resolving overloaded function calls in #C++. In Lippman's book, 'The C++ Primer' there is an example on page 155 #which says that the following function call: # # print( 'a' ) ; # #exactly matches the overloading: # # extern void print( char ) ; # # Is this an error? I don't know C++, but in C the type of the No, it is not an error. You are correct when you state the type of 'a' in C, but looking at Lippman's book again, see appendix C.2: In C++, the type of a literal character constant is char; in C it is int. He goes on to state the purpose for this is to overload on char. #expression 'a' is 'int' not char so I don't see how this could be an #exact match. Is C++ different from C in this regard? ^^^^^^^^^^^^^^^Yes. :*) Gary