Changes

Jump to: navigation, search

C/C++ FAQ

719 bytes added, 16:20, 1 October 2012
no edit summary
'''Q:''' Can a functional pointer be used to point to an overloaded function? If so, which function will it call when the pointer is dereferenced and why? '''''Submitted by:''''' ''Gideon Thomas and Marie Karimizadeh''
'''A:'''Function Pointer can be used to point to any function with the same signature as its own.<br>"Signature is the information about a function that participates in overload resolution: its parameter-type-list... Function signatures do not include return type, because that does not participate in overload resolution." (Working Draft, Standard for Programming Language C++ 2005-10-19, p3, 1.3.11 signature)<br>In the case of overloaded functions the only thing they have in common is the name. Signatures are different, hence the same pointer to function can't be used for both of them.<br> Back to your question. Call to Function Pointer will call an overloaded function with the same signature. (Submitted by Team42) 
----

Navigation menu