diff --git a/chapters/c.adoc b/chapters/c.adoc index 8c6b105..b5c9de1 100644 --- a/chapters/c.adoc +++ b/chapters/c.adoc @@ -404,14 +404,14 @@ int main() { printf("\n This is arr[0]: %c ", arr[0]); printf("\n This is *arr: %c ", *(arr+0)); //as well as: - printf("\n This is arr[0]: %c ", arr[1]); - printf("\n This is *(arr+0): %c ", *(arr+1)); - printf("\n This is arr[1]: %c ", arr[2]); - printf("\n This is *(arr+1): %c ", *(arr+2)); - printf("\n This is arr[2]: %c ", arr[3]); - printf("\n This is *(arr+2): %c ", *(arr+3)); - printf("\n This is arr[3]: %c ", arr[4]); - printf("\n This is *(arr+3): %c ", *(arr+4)); + printf("\n This is arr[1]: %c ", arr[1]); + printf("\n This is *(arr+1): %c ", *(arr+1)); + printf("\n This is arr[2]: %c ", arr[2]); + printf("\n This is *(arr+2): %c ", *(arr+2)); + printf("\n This is arr[3]: %c ", arr[3]); + printf("\n This is *(arr+3): %c ", *(arr+3)); + printf("\n This is arr[4]: %c ", arr[4]); + printf("\n This is *(arr+4): %c ", *(arr+4)); //understanding that, you can see now why in C, a thing that looks very weird as the following, makes sense: printf("\n This is 1[arr]: %c ", 1[arr]); //As you see, it printed 'e', because that expression is just *(1+a), which is the same as *(a+1)