Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes

C Programming Code Examples

Learn C Language

regfree() Function in C Programming Language

regfree() Function in C
Release memory allocated for a regular expression. The regfree() function frees any memory that was allocated by the regcomp() function to implement the regular expression preg. After the call to the regfree() function, the expression that is defined by preg is no longer a compiled regular or extended expression.
Syntax for regfree() Function in C
#include <regex.h> void regfree(regex_t *preg);
A pointer to the regex_t object for the regular expression that you want to free; see regcomp().
/* release memory allocated for a regular expression by regfree() function code example */ #include <regex.h> #include <stdio.h> #include <stdlib.h> int main(void) { regex_t preg; char *pattern = ".*(simple).*"; int rc; if (0 != (rc = regcomp(&preg, pattern, REG_EXTENDED))) { printf("regcomp() failed, returning nonzero (%d)\n", rc); exit(EXIT_FAILURE); } regfree(&preg); printf("regcomp() is successful.\n"); return 0; /************************************************************ The output should be similar to: regcomp() is successful. ************************************************************/ }

C program input sides of a triangle and check whether a Triangle is Equilateral, Scalene or Isosceles triangle using if else. Triangle is said Equilateral Triangle, if all its sides are equal. If

C Programming Code to input two numbers from user and find their power using pow() function. How to find power of a number in c. How to use pow() function in C programming.

Read stoplist into binary tree, expects one entry per line. Split string into tokens, return token array. Make sure, copy string to a safe place. Always keep last entry null terminated.

Lets find the length of the string using library function strlen(). A "string" is charracter array and a "Character Array" have character range between 0 to length-1. Thus we have position

Check whether a number is divisible by 5 and 13 or not using if else. A number is divisible by some other number if it gives 0 as remainder. To check if a number is exactly divisible by a...