C String Programs
- C program to create and print array of strings
- C program to compare two strings using pointers
- C program to print indexes of a particular character in a string
- C program to capitalize first character of each word in a string
- C program to find the frequency of a character in a string
- C program to read a string and print the length of the each word
- C program to eliminate/remove all vowels from a string
- C program to eliminate/remove first character of each word from a string
- C program to read n strings and print each string\'s length
- C program to copy one string to another and count copied characters
- C program to remove all spaces from a given string
- C program to convert a string to sentence case
- C program to remove alphabets from an alphanumeric string
- C program to eliminate all vowels from a string
- C program to swap adjacent characters of a string
- C program to read time in string format and extract hours, minutes and second also check time validity
- Creating string buffer (character pointer), allocating memory at run time in C
- memcpy() function in C with Example
- Write your own memcpy() function in C
- memset() function in C with Example
- Write your own memset() function in C
- C program to compare strings using strcmp() function
- C program to check a string is palindrome or not without using library function
- C program to check a string is palindrome or not using recursion
- C program to print the biggest and smallest palindrome words in a string
- C program to print the smallest word in a string
- C program to print the biggest word in a string
- C program to reverse a string using recursion
- C program to reverse every word of the given string
- C program to remove a given word from the string
- C program to delete duplicate words in the string
- C program to sort strings in alphabetical order
- C program to find the frequency of the given word in a string
- C program to find the sum of all digits in the alphanumeric string
- C program to copy a string to another string using recursion
- C program to find the first capital letter in a string using recursion
- C program to find the first capital letter in a string without using recursion
- C program to find the frequency of every word in the given string
- C program to find the highest frequency of a character in the given string
- C program to print all possible subsets of a given length in string
- C program to check two strings are anagram or not
- C program to find a specific word ends with a specific character in the string
- C program to split the string using the strtok() function
- C program to split the string using strtok_r() function
- C program to demonstrate the strstr() function
- C program to implement own strstr() function
- C program to demonstrate the strpbrk() function
- C program to implement the strpbrk() user-defined function
- C program to sort the words of the string
- C program to implement the KMP pattern search algorithm
Example:
Output
Explanation:
In this example, we declared character array arr of LEN bytes (LEN is a macro with the value 10), when we printed the value of arr, the output is garbage because array is uninitialized. Then, we used myMemSet() and filled all elements by 0. Then, printed the elements again the value of all elements were 0. Then, we filled first 3 elements with -1 and next 3 elements with -2 and next 3 elements with -3. Thus the values of all elements at the end: -1 -1 -1 -2-2 -2 -3 -3 -3 0.
need an explanation for this answer? contact us directly to get an explanation for this answer