Category

C Tutorial

76 posts

index.ts
</>

Structure in C with Example

In C programming, the structure is user-defined data types that allow us to store the combination of different data types together. All the different data type variables are represented by a single name. As we have studied earlier that Array can hold only a similar type of variable in contiguous mem

April 9, 2021 Read more →
index.ts
</>

C String – strchr() function

strchr() function in C is used to search the stated character in a string. It searches the string for the character and stops when the first time the character is found. And if the string needs to be printed, only the character starting from the searched character to the end is printed. The strchr()

April 8, 2021 Read more →
index.ts
</>

C String – strupr() function

strupr() function in C String converts all the characters present in a given string to Uppercase. The strupr() function is defined in the header file string.h. It takes a single argument that is the name of the string and is written as follows. strupr(string_name); C Program for strupr() function Ou

April 8, 2021 Read more →
index.ts
</>

C String – strlwr() function

strlwr() function in C String converts all the characters present in a given string to Lowercase. The strlwr() function is defined in the header file string.h. It takes a single argument that is the name of the string and is written as follows. strlwr(string_name); C Program for strlwr() function Ou

April 8, 2021 Read more →
index.ts
</>

C String – strrev() function

Reversing a string in C can be done by strrev() function in a single line. This function simply reverses the given string in a program. The strrev() function is defined in the header file string.h. It takes a single argument that is the name of the string and is written as follows. strrev(string_nam

April 8, 2021 Read more →
index.ts
</>

C String – strcmp() function

strcmp() function is used to compare two string to each other and returns an integer value. The strcmp() function is defined in the header file string.h. It takes two arguments, the name of the first string and the second string. These two strings are compared with each other and the returned intege

April 8, 2021 Read more →
index.ts
</>

C String – strcat() function

strcat() function is used to combine two string together to form a single string in a program. It concatenates two strings and the final result is returned to the first string. The strcat() function is defined in the header file string.h. It takes two arguments, the name of the first string and the

April 8, 2021 Read more →
index.ts
</>

C String – strcpy() function

strcpy() function in C is used to copy the contents from one string (source) to another string (destination). The strcpy() function is defined in the header file string.h. It takes two arguments, destination and source. The source is from where the string is taken and the destination is to where the

April 8, 2021 Read more →
index.ts
</>

C String – strlen() function

strlen() function in C is used to calculate the length of the given string. It counts the number of characters present in a String excluding the null character ‘\0‘. The strlen() function is defined in the header file string.h. It takes one argument that is the string name and written as

April 8, 2021 Read more →
index.ts
</>

C – String Functions

Often, we need t to manipulate the String according to the need of the program. However, we can do that manually in a program but that is complex to comprehend and the program becomes very large. So to make it easy, C provides us with some library functions. And these functions are defined under str

April 8, 2021 Read more →
index.ts
</>

Strings in C

This tutorial contains about the String in C programming. You will learn about the declaration, initialization of String, and the use of string with examples. What is String? A string is defined as a series of characters or an array of characters(terminated by a null character ‘\0’). Eac

April 2, 2021 Read more →