STRING OPERATION

Strings in C

Strings is an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’.

Declaration of strings: Declaring a string is as simple as declaring a one dimensional array. Below is the basic syntax for declaring a string.

    char str name[size];

In the above syntax str_name is any name given to the string variable and size is used define the length of the string, i.e the number of characters strings will store. Please keep in mind that there is an extra terminating character which is the Null character (‘\0’) used to indicate termination of string which differs strings from normal character arrays.            


                                                

1.STRING OPERATION. This section covers C programming examples on String Operations. Unlike arrays we do not need to print a string, character by character. The C language does not provide an inbuilt data type for strings but it has an access specifier “%s” which can be used to directly print and read strings. You can see in the above program that string can also be read using a single scanf statement.

  • CLICK ON THE FOLL LINKS FOR STRING OPERATIONS.           



1 comment:

  1. thankyou for these provide us linklist operation also

    ReplyDelete

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages