Tag Archives: Strings

Longest sub string of 0’s in a Binary string

Given a string S containing 0’s and 1’s, the task is to find the length of longest continuous substring of 0’s from the given string. Examples: Input: S = 1111111 Output: 0 Explanation: There is no substring of 0’s hence output is 0. Approach: The given problem can be solved by simply iterating through the string. Follow the… Read More »

What is string.h and why do we use?

The string.h header defines one variable type, one macro, and various functions for manipulating arrays of characters. Functions provided by string.h The string.h header file declares a set of functions to work strings. To perform operations like comparison, concatenation, and copying, this string.h library is widely used. This header file defines several functions to manipulate C strings and… Read More »

Strings in C

In this article, you’ll learn about strings in C programming. Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’. Example : char name[] = “first name” ; Declaration of strings : When the compiler encounters a sequence of characters enclosed… Read More »