February 2020
Beginner to intermediate
616 pages
15h 16m
English
To ensure that a string is a palindrome, we first need to ensure that the original string and its reverse form are of the same length.
Let's suppose that the original string is sanjay and it is assigned to a string variable, str. The string is a character array, where each character is stored individually as an array element and the last element in the string array is a null character. The null character is represented as \0 and is always the last element in a string variable in C, as shown in the following diagram:

As you can see, the string uses zero-based indexing, that is, the first character is placed at index location ...
Read now
Unlock full access