Tag Archives: C-String

Using inbuilt function Using the inbuilt function strcpy() from string.h header file to copy one string to the other. strcpy() accepts a pointer to the… Read More
std::string::crbegin() The std::string::crbegin() is a string class built-in function that returns a constant reverse iterator referring to the last element in the string. Using this… Read More
As string.h header file contains inbuilt functions to handle Strings in C/C++, the ctype.h/<cctype> contains inbuilt functions to handle characters in C/C++ respectively. Characters are… Read More
Given a string and write a C program to count the number of vowels and consonants in this string. Examples: Input: str = "geeks for… Read More
We all know how to store a word or String, how to store characters in an array, etc. This article will help you understand how… Read More
Given a string str and a character ch, this article tells about how to append this character ch to this string str at the end.… Read More
Given a string, the task is to reverse this String using pointers. Examples: Input: Geeks Output: skeeG Input: GeeksForGeeks Output: skeeGroFskeeG Approach: This method involves… Read More
Strings in C: Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated… Read More
Given an array of string literals, reverse the array. Examples: Input : arr[] = {"Coding", "Never", "Fail", "Me"} Output : arr[] = {"Me", "Fail", "Never",… Read More
The strlwr( ) function is a built-in function in C and is used to convert a given string into lowercase. Syntax: char *strlwr(char *str); Parameter:… Read More
The strcmpi() function is a built-in function in C and is defined in the “string.h” header file. The strcmpi() function is same as that of… Read More
The tolower() function is defined in the ctype.h header file. If the character passed is a uppercase alphabet then the tolower() function converts a uppercase… Read More
The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts… Read More
The strlen() function calculates the length of a given string.The strlen() function is defined in string.h header file. It doesn’t count null character ‘\0’. Syntax:… Read More
The strupr( ) function is used to converts a given string to uppercase. Syntax: char *strupr(char *str); Parameter: str: This represents the given string which… Read More