{"id":81470,"date":"2021-07-05T09:00:19","date_gmt":"2021-07-05T03:30:19","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=81470"},"modified":"2021-07-05T09:00:19","modified_gmt":"2021-07-05T03:30:19","slug":"library-functions-in-c","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/","title":{"rendered":"Library Functions in C"},"content":{"rendered":"<p>C standard library functions are one of the most important and useful topics in the C programming language. Without standard C library functions, you cannot execute a program in C. These functions are provided by the system and then stored in the library.<\/p>\n<h3>What are Standard library functions in C?<\/h3>\n<p>These functions are also known as built-in functions in C. And these functions are stored in a common collection called a library. Each function provides a different operation. With the help of these standard functions, a programmer can get the desired output of his\/her program easily.<\/p>\n<p>During the time of designing compilers, these library functions are created.<\/p>\n<h3>Advantages of using C standard library functions<\/h3>\n<p><strong>1. Usability:-<\/strong> One of the important advantages of using these functions is that it will allow a programmer to use the pre-existing code available in the C compiler. These library functions are easy to use.<\/p>\n<p><strong>2. Optimization:-<\/strong> A group of developers always make sure that these standard library functions are up to date. And they are also making efficient code that will optimize the performance.<\/p>\n<p><strong>3. Portable:-<\/strong> You can use these standard library functions anytime and anywhere. They are platform-independent.<\/p>\n<p><strong>4. Time Saving:-<\/strong> If you have to find a square root and print the output on the screen then you don\u2019t have to write numerous lines of code. With the help of standard C library functions, you can do this type of work easily.<\/p>\n<p><strong>5. User-Friendly Syntax:-<\/strong> In C, the syntax of these library functions is easy to understand and implement.<\/p>\n<p><strong>6. Flexibility:-<\/strong> A programmer can easily modify their code or program with the help of standard library functions.<\/p>\n<h3>Header files in C<\/h3>\n<p>You can use these standard C library functions by declaring header files. Different header files include different functions and different operations.<\/p>\n<p>Below is the list of header files in C:-<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Header File<\/b><\/td>\n<td><b>What it does<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdio.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform input and output operations like print(), scanf().<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">string.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform string handling operations like strlen(), strcmp() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">conio.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to perform console input and output operations.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdlib.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform standard utility functions like malloc(), calloc() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">math.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform mathematical operations like sqrt(), pow() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">ctype.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to perform character type functions like isdigit(), isalpha() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">time.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to perform operations related to date and time.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">assert.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to verify assumptions made by a program and print a message if the assumption is false using functions like assert() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">locale.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform localization like functions such as setlocale() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signal.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mainly used to perform signal handling functions such as signal(), raise() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">setjmp.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to perform jump functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdarg.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to perform standard argument functions like va_start() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">errno.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">For performing error handling operations such as errno() to indicate the errors.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Below are the header files in detail.<\/p>\n<h4>stdio.h<\/h4>\n<p>A programmer has to put this header file in every program. This is a basic header file in C. This header file mainly used to perform input and output functions like:-<\/p>\n<ul>\n<li><strong>printf():-<\/strong> Display the output on the screen.<\/li>\n<li><strong>scanf():-<\/strong> Take input from the user.<\/li>\n<li><strong>getchar():-<\/strong> Return characters on the screen.<\/li>\n<li><strong>putchar():-<\/strong> Display output as a single character.<\/li>\n<li><strong>fgets():-<\/strong> Take line as an input.<\/li>\n<li><strong>puts():-<\/strong> Display a line on the screen.<\/li>\n<li><strong>fopen():-<\/strong> Open a file.<\/li>\n<li><strong>fclose():-<\/strong> Close a file.<\/li>\n<li><strong>getw():-<\/strong> Reads an integer from file.<\/li>\n<li><strong>putw():-<\/strong> Writes an integer to file.<\/li>\n<li><strong>fgetc():-<\/strong> Reads a character from file.<\/li>\n<li><strong>putc():-<\/strong> Writes a character to file.<\/li>\n<li><strong>fputc():-<\/strong> Writes a character to file.<\/li>\n<li><strong>fgets():-<\/strong> Mainly used to read a string one line at a time.<\/li>\n<li><strong>fputs():-<\/strong> Writes string to a file.<\/li>\n<li><strong>feof():-<\/strong> Finds end of file.<\/li>\n<li><strong>fgetchar:-<\/strong> Reads a character from the keyboard.<\/li>\n<li><strong>fgetc():-<\/strong> Reads a character from file.<\/li>\n<li><strong>fprintf():-<\/strong> Writes formatted data to a file.<\/li>\n<li><strong>fscanf():-<\/strong> Reads formatted data from a file.<\/li>\n<li><strong>fputchar:-<\/strong> Writes a character from the keyboard.<\/li>\n<li><strong>fseek():-<\/strong> Moves file pointer to given location.<\/li>\n<li><strong>SEEK_SET:-<\/strong> Used for moving the file pointer at the starting of a file.<\/li>\n<li><strong>SEEK_CUR:-<\/strong> Moves file pointer at given location.<\/li>\n<li><strong>SEEK_END:-<\/strong> Moves file pointer at the end of file.<\/li>\n<li><strong>ftell():-<\/strong> Gives current position of file pointer.<\/li>\n<li><strong>rewind():-<\/strong> You can move the file pointer at the beginning of the file.<\/li>\n<li><strong>putc():-<\/strong> Writes a character to file.<\/li>\n<li><strong>sprint():-<\/strong> Writes formatted output to string.<\/li>\n<li><strong>sscanf():-<\/strong> Reads formatted input from a string.<\/li>\n<li><strong>remove():-<\/strong> Deletes a file.<\/li>\n<li><strong>flush():-<\/strong> Flushes a file.<\/li>\n<\/ul>\n<p><strong>Example of stdio.h in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint main() {\n  char name[20]=\"TechVidvan\";\n  printf(\"Tutorial name is: %s\\n\",name);\n  int age;\nprintf(\"Enter your age: \\n\");\n  scanf(\"%d\",&amp;age);\n  printf(\"Your age is: %d\\n\",age);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Tutorial name is: TechVidvan<br \/>\nEnter your age:<br \/>\nYour age is: 20<\/div>\n<h4>&lt;stdlib.h&gt; header file<\/h4>\n<p>This header file is used to perform dynamic allocations through malloc(), calloc(), free(), realloc().<\/p>\n<h4>malloc function in C:-<\/h4>\n<p>It is used for dynamic allocation in C. It is mainly used for allocating a block of memory dynamically. And it returns a null pointer during the execution of the program.<\/p>\n<p><strong>Syntax of C Malloc Function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pointer_name = (cast_type *) malloc (byte_size);<\/pre>\n<p><strong>Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pointer = malloc(int *) malloc(10 * sizeof(int));\n<\/pre>\n<p><strong>Example:- malloc() function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdlib.h&gt;\n#include &lt;stdio.h&gt;\nint main(){\nint *point;\npoint = malloc(10 * sizeof(*point)); \/\/ block of 15 integers!\n*(point + 1) = 10; \/* assign 480 to sixth integer *\/\nprintf(\"Value of second integer is %d\",*(point + 1));\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Value of second integer is 10<\/div>\n<h4>calloc() function in C<\/h4>\n<p>Calloc stands for Contiguous allocation. The main purpose of this is to allocate multiple blocks of memory. This function is used for allocating memory to complex data structures like arrays, structures etc.<\/p>\n<p><strong>Syntax of C Calloc Function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pointer = (cast_type *) calloc (no_of_bytes, size_of_cast_type);<\/pre>\n<p><strong>Example of Calloc Function in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pointer = calloc(4, sizeof(int));\n<\/pre>\n<p><strong>Example of C calloc() function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\nint main() {\nint a, *point, sum = 0;\npoint = calloc(4, sizeof(int));\nprintf(\"TechVidvan Tutorial: calloc() function!\\n\");\nprintf(\"Sum of first 4 terms!\\n\");\nfor (a=0;a&lt;4;a++) {\n*(point + a) = a;\nsum = sum + *(point + a);\n}\nprintf(\"Sum is: %d\", sum);\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan Tutorial: calloc() function!<br \/>\nSum of first 4 terms!<br \/>\nSum is: 6<\/div>\n<h4>free() function in C<\/h4>\n<p>It is used to deallocate or release memory in C programs. During dynamic allocation, you have to free some memory explicitly. If not, you may encounter errors in compilation.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">free(name_of_pointer);<\/pre>\n<p><strong>Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">free(point);<\/pre>\n<p><strong>Example:- free() function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\nint main() {\nint *point = malloc(4 * sizeof(*point));\n*(point + 3) = 5;\nprintf(\"Third integer value is: %d\",*(point + 3));\nfree(point);\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Third integer value is: 5<\/div>\n<h4>realloc() function in C<\/h4>\n<p>It is used for allocating more memory to the already allocated memory. realloc() stands for reallocation of memory.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">point = realloc(point, new_sizeof())<\/pre>\n<p><strong>Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">point = (int*) malloc(4 * sizeof(int));\npoint = realloc(point, 6 * sizeof(int));\n<\/pre>\n<p><strong>Example:- free() function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\nint main () {\nchar *string_name;\nstring_name = (char *) malloc(20);\nstrcpy(string_name, \"TechVidvan\");\nstring_name = (char *) realloc(string_name, 30); \/\/ Reallocating memory\nstrcat(string_name, \" Tutorials!\");\nprintf(\"Favourite website for C tutorials is: %s\", string_name);\nreturn(0);\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Favourite website for C tutorials is: TechVidvan Tutorials!<\/div>\n<p><strong>NOTE:-<\/strong> If you want to use the above mentioned functions then you have to include <strong>&lt;stdlib.h&gt;<\/strong> header file in your program code.<\/p>\n<h4>&lt;math.h&gt; header file<\/h4>\n<p>This header file will let you perform some mathematical operations in your program. This header file includes functions such as:-<\/p>\n<ul>\n<li><strong>sqrt()<\/strong> \u2013 Find the square root of a number<\/li>\n<li><strong>pow()<\/strong> \u2013 Find the power raised to that number.<\/li>\n<li><strong>fabs()<\/strong> \u2013 Find the absolute value of a number.<\/li>\n<li><strong>log()<\/strong> \u2013 Find the logarithm of a number.<\/li>\n<li><strong>sin()<\/strong> \u2013 Find the sine value of a number.<\/li>\n<li><strong>cos()<\/strong> \u2013 Find the cosine value of a number.<\/li>\n<li><strong>tan()<\/strong> \u2013 Find the tangent value of a number.<\/li>\n<\/ul>\n<p><strong>Example:-<\/strong> <strong>&lt;math.h&gt; header file<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;math.h&gt;\nint main()\n{\nprintf(\"TechVidvan Tutorials: &lt;math.h&gt; header file examples!\\n\\n\");\nint num=4, squareRoot;\nint power = 3, result_of_power;\ndouble num1 = -7.2, res;\ndouble tan_res;\nsquareRoot = sqrt(num);\nprintf(\"Square root of %d is: %d\\n\", num, squareRoot);\nresult_of_power = pow(num,power);\nprintf(\"Power of %d is: %d\\n\",num,result_of_power);\nres = fabs(num1);\nprintf(\"Absolute value of %f is: %d\\n\",num1,res);\ntan_res = tan(num);\nprintf(\"Tangent value of %d is: %f\",num,tan_res);\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>TechVidvan Tutorials: &lt;math.h&gt; header file examples!<\/p>\n<p>Square root of 4 is: 2<br \/>\nPower of 4 is: 64<br \/>\nAbsolute value of -7.200000 is: 0<br \/>\nTangent value of 4 is: 1.157821<\/p>\n<\/div>\n<p><strong>NOTE:-<\/strong> If you want to use the above mentioned functions then you have to include <strong>&lt;math.h&gt;<\/strong> header file in your program code.<\/p>\n<h4>&lt;ctype.h&gt; header file<\/h4>\n<p>This header file includes functions which will help you in character handling. The <strong>&lt;ctype.h&gt;<\/strong> header file has functions such as:-<\/p>\n<ul>\n<li><strong>isalpha()<\/strong> \u2013 Check if the character is an alphabet or not.<\/li>\n<li><strong>isdigit()<\/strong> \u2013 Check if the character is a digit or not.<\/li>\n<li><strong>isalnum()<\/strong> \u2013 Check if the character is alphanumeric or not.<\/li>\n<li><strong>isupper()<\/strong> \u2013 Check if the character is in uppercase or not<\/li>\n<li><strong>islower()<\/strong> \u2013 Check if the character is in lowercase or not.<\/li>\n<li><strong>toupper()<\/strong> \u2013 Convert the character into uppercase.<\/li>\n<li><strong>tolower()<\/strong> \u2013 Convert the character into lowercase.<\/li>\n<li><strong>iscntrl()<\/strong> \u2013 Check if the character is a control character or not.<\/li>\n<li><strong>isgraph()<\/strong> \u2013 Check if the character is a graphic character or not.<\/li>\n<li><strong>isprint()<\/strong> \u2013 Check if the character is a printable character or not<\/li>\n<li><strong>ispunct()<\/strong> \u2013 Check if the character is a punctuation mark or not.<\/li>\n<li><strong>isspace()<\/strong> \u2013 Check if the character is a white-space character or not.<\/li>\n<li><strong>isxdigit()<\/strong> \u2013 Check if the character is hexadecimal or not.<\/li>\n<\/ul>\n<p><strong>Example:- &lt;ctype.h&gt; header file<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;ctype.h&gt;\nint main()\n{\nprintf(\"TechVidvan Tutorials: &lt;ctype.h&gt; header file examples!\\n\\n\");\nchar a,res;\nchar b,c;\na='T';\nb = 't';\nc = '7';\nprintf(\"Converting %c to lower case: %c\\n\",a,tolower(a));\nif(isalpha(a)){\n  printf(\"It is a character!\\n\");\n}\nif(isdigit(a)){\n  printf(\"It is a digit!\\n\");\n}\nelse{\n  printf(\"It is not  digit!\\n\");\n}\nif(isalnum(c)){\n  printf(\"It is alphanumeric!\\n\");\n}\nprintf(\"Converting %c to upper case: %c\\n\",b,toupper(b));\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan Tutorials: &lt;ctype.h&gt; header file examples!Converting T to lower case: t<br \/>\nIt is a character!<br \/>\nIt is not digit!<br \/>\nIt is alphanumeric!<br \/>\nConverting t to upper case: T<\/div>\n<p><strong>NOTE:-<\/strong> You have to include \u201c<strong>#include &lt;ctype.h&gt;<\/strong>\u201d to run the above character handling functions.<\/p>\n<h4>&lt;string.h&gt; header file<\/h4>\n<p>This header file has functions which will help in handling and manipulating strings in your program code.<\/p>\n<p>&lt;string.h&gt; header file has functions such as:-<\/p>\n<ul>\n<li><strong>strcpy(s1, s2):-<\/strong> Copies string s2 into string s1.<\/li>\n<li><strong>strcat(s1, s2):-<\/strong> Used for concatenating string s2 at the end of string s1.<\/li>\n<li><strong>strlen(s1):-<\/strong> Returns the length of string s1.<\/li>\n<li><strong>strcmp(s1,<\/strong> <strong>s2):-<\/strong> Compares string s1 and s2.<\/li>\n<li><strong>strlwr(s1):-<\/strong> Converts string s1 to lowercase.<\/li>\n<li><strong>strupr(s1):-<\/strong> Converts string s1 to uppercase.<\/li>\n<li><strong>strchr(s1, c):-<\/strong> Mainly used to return a pointer to the first occurrence of character c in s1.<\/li>\n<li><strong>strstr(s1, s2):-<\/strong> Used to return a pointer to the first occurrence of s2 in string s1.<\/li>\n<li><strong>strrev(s1):-<\/strong> Reverse the string s1.<\/li>\n<li>s<strong>trncmp(s1, s2, n):-<\/strong> It returns greater than 0 if s1&gt;s2. And it returns less than 0 if s1&lt;s2. It returns 0 if the first n characters of s1 is equal to the first n characters of s2.<\/li>\n<li><strong>strncpy(s1, s2, n):-<\/strong> Copies the first n characters of s2 to s1.<\/li>\n<li><strong>strncat(s1, s2, n):<\/strong>&#8211; Concatenates first n characters of s2 to the end of s1.<\/li>\n<\/ul>\n<p><strong>Example:- &lt;string.h&gt; header file<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\nint main () {\nchar s1[20] = \"Greeting from \";\nchar s2[20] = \"TechVidvan!\";\nchar s3[20];\nint len;\nint cmp;\nstrcpy(s3, s1); \/\/ copies string s1 into s3!\nprintf(\"Coping string s1 into s3: %s\\n\", s3 );\nstrcat( s1, s2); \/\/ concatenates s1 and s2!\nprintf(\"Concatenating string s1 and s2: %s\\n\", s1 );\nlen = strlen(s1); \/\/ length of string s1\nprintf(\"Length of string s1 is: %d\\n\", len );\n\/\/ comparing string s1 and s2!\ncmp = strcmp(s1,s2);\nif (cmp == 0){\n  printf(\"String s1 and s2 are equal!\\n\");\n}\nelse{\n  printf(\"String s1 and s2 are not equal!\\n\");\n}\nreturn 0;\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Coping string s1 into s3: Greeting from<br \/>\nConcatenating string s1 and s2: Greeting from TechVidvan!<br \/>\nLength of string s1 is: 25<br \/>\nString s1 and s2 are not equal!<\/div>\n<p><strong>NOTE:-<\/strong> You have to include \u201c<strong>#include &lt;string.h&gt;<\/strong>\u201d to run the above string handling functions.<\/p>\n<h4>&lt;conio.h&gt; header file<\/h4>\n<p>Main purpose of this header file is to perform input\/output operations such as <strong>clrscr()<\/strong> to clear the screen and <strong>getch()<\/strong> to get the character from the keyboard.<\/p>\n<p><strong>NOTE:-<\/strong> You cannot use <strong>&lt;conio.h&gt;<\/strong> header file in Linux because Linux does not support it. But in Windows, you can use it.<\/p>\n<h3>Summary<\/h3>\n<p>Without header files, you cannot run any C programs. Different header files include different functions which help a programmer to write numerous lines of code easily. C supports different header files like stdio.h, conio.h, string.h, math.h, stdlib.h etc. These header files allow a programmer to use the pre-existing code available in the C compiler.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C standard library functions are one of the most important and useful topics in the C programming language. Without standard C library functions, you cannot execute a program in C. These functions are provided&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":81685,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3510],"tags":[3724,3725,3726,3727,3728],"class_list":["post-81470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-conio-h-header-file","tag-header-files-in-c","tag-library-functions-in-c","tag-stdio-h-header-file","tag-string-h-header-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Library Functions in C - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn about C library functions which is one of the most important and useful topic in the C programming language. Learn with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Library Functions in C - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn about C library functions which is one of the most important and useful topic in the C programming language. Learn with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-05T03:30:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Library Functions in C - TechVidvan","description":"Learn about C library functions which is one of the most important and useful topic in the C programming language. Learn with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Library Functions in C - TechVidvan","og_description":"Learn about C library functions which is one of the most important and useful topic in the C programming language. Learn with examples.","og_url":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-05T03:30:19+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Library Functions in C","datePublished":"2021-07-05T03:30:19+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/"},"wordCount":1780,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg","keywords":["conio.h header file","Header files in C","Library Functions in C","stdio.h header file","string.h header file"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/","url":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/","name":"Library Functions in C - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg","datePublished":"2021-07-05T03:30:19+00:00","description":"Learn about C library functions which is one of the most important and useful topic in the C programming language. Learn with examples.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Library-Functions-in-C.jpg","width":1200,"height":628,"caption":"Library Functions in C"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/library-functions-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Library Functions in C"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=81470"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81470\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/81685"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=81470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=81470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=81470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}