February 2020
Beginner to intermediate
616 pages
15h 16m
English
Let's assume that we have defined a string, str1, of some length, and have entered the following characters—racecar.
Each of the characters of the string racecar will be assigned to the respective index locations of str1, that is, r will be assigned to str1[0], a will be assigned to str1[1], and so on. Because every string in C is terminated by a null character, \0, the last index location of str1 will have the null character \0, as follows:

Using the library function strlen, the length of str1 is computed and a for loop is used to access all of the characters of str1, one by one, except for the first character. ...
Read now
Unlock full access