what is the difference between function declaration and signature?

前端 未结 5 1639
故里飘歌
故里飘歌 2020-12-13 00:13

In C or C++ what is the difference between function declaration and function signature?

I know something of function declaration but function signature is totally ne

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 00:48

    The function signature doesn't include the return type or linkage type of the function.

    OK, Wikipedia disagrees with me on the return type being included. However I know that the return type is not used by the compiler when deciding if a function call matches the signature. This previous StackOverflow question appears to agree: Is the return type part of the function signature?

提交回复
热议问题