0% found this document useful (0 votes)
22 views

String Functions: Strcpy Function

This document describes several string functions in C including strcpy() to copy one string to another, strlen() to return the length of a string, strcmp() to compare two strings, strcat() to concatenate two strings, strncpy() to copy a specified number of characters from one string to another, strlwr() and strupr() to convert case of characters in a string, and strchr() to find the first occurrence of a character in a string.

Uploaded by

Hazrat Hayat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

String Functions: Strcpy Function

This document describes several string functions in C including strcpy() to copy one string to another, strlen() to return the length of a string, strcmp() to compare two strings, strcat() to concatenate two strings, strncpy() to copy a specified number of characters from one string to another, strlwr() and strupr() to convert case of characters in a string, and strchr() to find the first occurrence of a character in a string.

Uploaded by

Hazrat Hayat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

String Functions

strcpy( ) Function:
This function is used to copy one string in another string. Its syntax is strcpy(string1, string2);

strlen( ) Function:
This function is used to return the length of a string (All characters before null termination).
Its syntax is strlen(string1);

strcmp( ) Function:
This function is used to compare one string with another and returns a signed number whether str1 is greater than,
less than or equal to str2. Its syntax is strcmp(string1, string2);

strcat( ) Function:
This function is used to concatenates string 2 to the end of string 1. Its syntax is strcat(string1, string2);

Page 1|3

strncpy( ) Function:
This function is used to copy a specified number of characters to string1 to string2. Its syntax is strncpy(string1,
string2, n);

strlwr( ) Function:
This function is used to convert upper case letter to lower case. Its syntax is strlwr(String1);

strupr( ) Function:
This function is used to convert lower case letter to upper case. Its syntax is strupr(String1);

Page 2|3

strchr( ) Function:

Page 3|3

You might also like