What do you mean by signature of function?
What do you mean by signature of function?
A function signature is the "title" of the function that contains the return value, function name and parameter types, basically everything you need to correctly identify that function:
e.g.
int main(void) is a possible signature of main.
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
Never heard it called that. Perhaps 'prototype'.
I've never heard that term, "signature". But anyway, here's some example signatures. The return type's in red, the title's in blue, and the arguments are in green.
Code:int main(int argc, char *argv[]) FILE *fopen(const char *restrict filename, const char *restrict mode) int sqrt(int x)
I've heard the term signature when talking about calling conventions or when talking about the output of CRC32, checksum and other similar algorithms applied to the whole or portions of raw binary function code (used by some anti-cheat systems to detect changes in functions).
As far as I can tell, the 1999 edition of the C standard does not even contain the word "signature", and my guess for this is that this is because C does not have function overloading, so it would suffice to talk about a function type or a function declaration.Originally Posted by C++03 Clause 1.3.10
Last edited by laserlight; 09-21-2010 at 12:41 AM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
For C++, the return type isn't part of the signature, since you can't overload a function by only changing its return type.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
As far as I know signature is a generic term and is non specific to a particular language. It's true that signatures are particularly relevant for overloading, but the term is not strictly related to languages that allow overloading.
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.