Strings

Gapfill exercise

  
Enter your answers in the gaps. When you have entered all the answers, click on the "Check" button.
What is the difference between char array and string literal?
There are two main differences between char array and literal.
We need to add the null '\0' at the end of the array by ourself whereas, it is internally by the in the case of the character array.
The string literal cannot be reassigned to another set of whereas, we can the characters of the .

Describe Traversing String?
Traversing the string is one of the most important in any of the languages. We may need to manipulate a very large text which can be done by traversing the text. string is somewhat from the traversing an integer . We need to know the length of the array to traverse an array, whereas we may use the null in the case of to identify the end the string and the loop.
Hence, there are two ways to a string.
By using the of string
By using the character.

Describe gets() function?
he gets() enables the user to enter some followed by the enter key. All the entered by the user get stored in a array. The null character is added to the array to make it a . The gets() allows the user to enter the -separated strings. It the string entered by the user.

Describe puts() functions?
The puts() function is very much similar to () function. The puts() function is used to print the string on the which is previously read by using gets() or scanf() function. The () returns an integer value the number of being printed on the console. Since, it prints an additional newline with the string, which moves the to the new line on the console, the value returned by puts() will always be equal to the number of present in the string plus 1.

What are the different String functions?
1)strlen(string_name) - the length of name.
2)(destination, source) - copies the of source string to string.
3)(first_string, second_string) - concats or joins first string with string. The result of the string is in first string.
4)(first_string, second_string)- compares the first with second string. If both strings are same, it 0.
5)(string)- returns reverse string.
6)strlwr(string)- returns string characters in .
7)(string)- string characters in uppercase.