Header Ads

Library Function:C Programming Language - Part 1.4

Library Function


Function is a reusable code block. Which could do a specific job. There are many functions with C programming. Those are called library functions. Like printf is a function, whose job is to see some output. Let us add the #include <stdio.h> text to the beginning of every program. Which means we already know. This means that the Standard Library Functions will be added. As we use printf, this is a function of standard I / O functions. Standard I / O has more functions, such as scanf (), getchar (), putchar () etc. These can be known from the following chapters.
Below are the included files and their functions. Detailed description of the use of each include file has been added to the link. You can take a look at the detailed example from the link.

The values ​​that are passed in any function are called arguments. Some library functions work without any arguments. Some functions take an argument. Again, some functions work with more than one argument.

Stdio.h: I / O functions:
Getchar () returns
Putchar () outputs
Printf () as previously described
Scanf () as previously described
Details about getchar & putchar and scanf & printf can be found from the following two links.

Getchar & putchar
Scanf & printf


String.h: String functions
Strcat () concatenates a copy of str2 to str1
Strcmp () Compare two strings
Strcpy () copys contents of str2 to str1
String Keys, the library functions can be known in detail: C - Strings / String



Ctype.h: Character functions
Isdigit () returns non-0 if arg is digit 0 to 9
Isalpha () returns non-0 if arg is a letter of the alphabet
Isalnum () returns non-0 if arg is a letter or digit
Islower () returns non-0 if arg is lowercase letter
Isupper () returns non-0 if arg is uppercase letter
 Details about Character functions and ASCII Character Set.
Math.h: Mathematics functions
Acos () returns arc cosine of arg
Asin () returns arc sine of arg
Atan () returns the arc tangent of arg
Cos () returns cosine of arg
Exp () returns natural logarithim e
Fabs () returns absolute value of num
Sqrt () returns square root of num


Time.h: Time and Date functions
Time () returns current calender time of system
Diffime () returns in secs between two times
Clock () returns number of system clock cycles since program execution


Stdlib.h: Miscellaneous functions
Malloc () provides dynamic memory allocation, covered in future sections
Rand () as already described previously
Srand () used to set the starting point for rand ()



No comments

Theme images by sebastian-julian. Powered by Blogger.