What is string? BCA 2nd semester.


 Definition of String character :-

It is a collection (set) of character with a double quotations system a string variable is always declared as an array.

    char string - variable [size]

    char name [25];

    char name [10]="UNIVERSITY";

Compiler provides a null character('0') at the end of the string.

Standard library function:-

1).strlen() function:- This function find the length of the string. It count and return the number of character present in a string.

                    n= strlen (strings);

2). strcat() function:- This function joint two string together. It take two arrangement and joint two source string to end of target string.

              strcat( string 1 , string 2);

3). strcmp() function:- This function compare two string to find out the source string are same or different. If the string are same if return a value 0.

               strcmp(string 1, string 2);

4). strcpy() function:- This function copy a string value to another string value.

           strcpy( string 1, string 2);

5). strrev() function:- this function reverse the string all the character in the given string.

         strrev( string- variable);


No comments:

Post a Comment

If you have any doubts, Please lets me know and Please Follow our Website