Friday, July 31, 2009

Difference between library functions and user defined functions in c language?

Does the phrase "user defined" mean anything to you?


.

Difference between library functions and user defined functions in c language?
A user defined function is something you the programmer has defined to perform a specific action or calculation in your program.





Example, you need to calculate somebody's age to the nearest minute. You create a calculateAge function:





double calculateAge(Date dateOfBirth)


{


}





So it is specific to your needs at this time.





A library function has been written by someone else, and is reusuable by many programmers to solve the same problem over and over.





Example: strcpy in C. If you are using C, you will never need to write functions for string manipulation because somebody else did that a long time ago...

flower girl

No comments:

Post a Comment