C Library and User Define Functions (UDF) - Functions in C



 c library and user define functions

Learn C - C tutorial - c library and user define functions - C examples - C programs

C Library and User Define Functions (UDF)

Library Functions

  • Library functions in C language are inbuilt functions which are grouped together and placed in a common place called library.
  • Each library function in C performs specific operation.
  • We can make use of these library functions to get the pre-defined output instead of writing our own code to get those outputs.
  • These library functions are created by the persons who designed and created C compilers.
  • All C standard library functions are declared in many header files which are saved as file_name.h.
  • Actually, function declaration, definition for macros are given in all header files.
  • We are including these header files in our C program using “#include<file_name.h>” command to make use of the functions those are declared in the header files.
  • When we include header files in our C program using “#include<filename.h>” command, all C code of the header files are included in C program. Then, this C program is compiled by compiler and executed.

User Define Functions

  • User Define Functions which are defined and declared by the programmer to do some particular task.
  • These are designed to re-use the code.

Sample Code

#include <stdio.h>
void message(void);
int main()
{
    message();
    message();
    return 0;
}
void message(void)
{
    printf("\nwikitechy...");
}

Output

wikitechy...
wikitechy...


View More Quick Examples


Related Searches to C Library and User Define Functions (UDF) - Functions in C