I am trying to read correctly this :
*(strarray[i]+j)=0;
I was understanding something like :
strarray[i][++j] = 0;
or
strarray[i][++j] = '\0';
but is not exactly the same. How could it be written correctly as an array subscripting notation?
Using the postfix array subscripting notation,
*(strarray[i]+j)=0;
will be
strarray[i][j]=0;
Quoting the C11 standard, chapter §6.5.2.1, Array subscripting
A postfix expression followed by an expression in square brackets
[]is a subscripted designation of an element of an array object. The definition of the subscript operator[]is thatE1[E2]is identical to(*((E1)+(E2))). [...]
In your case, you can consider E1 as strarray[i] and E2 as j.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With