You are on page 1of 12

FUNCTIONS IN

PROGRAMING FOR
P R O B L E M S O LV I N G
C++
NAME- RISHI SHAH
ROLL NO- S039
G U I D E D B Y V I N AYA K G A I K WA D
M B A T E C H D ATA S C I E N C E B AT C H
STRCMP()
• strcmp() is a built-in library function and is declared in <string.h>
header file. This function takes two strings as arguments and compare
these two strings lexicographically.

• The syntax of strcmp() is:


STRCMP()
STRCPY()
• strcpy() is a standard library function in C/C++ and is used to copy
one string to another. In C it is present in string.h header file and in C+
+ it is present in cstring header file.

• The syntax of strcpy() is:


STRCPY()
STRREV()
• The strrev() function is a built-in function in C and is defined in
string.h header file. The strrev() function is used to reverse the given
string.

• The syntax of strrev() is:


STRREV()
STRCAT()
• strcat() basically says to join two strings which means concatenating
two strings. Here with the help of this function, we can concatenate
two strings but here strcat functions in somewhat different ways. It
will append a copy of the source string to the end of the destination
string. The strcat() will consider two parameters or arguments.

• The syntax of strcat() is:


STRCAT()
STRLEN()
• 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’.

• The syntax of strlen() is:


STRLEN()
THANK
YOU

You might also like