1
chandu
4y

Why array is not increment or decrement in c programming?

Comments
  • 0
  • 4
    Because an array is not a pointer. An array is just the static start address (plus reserved memory).

    You can't increment/decrement the start address with the ++/-- operators because it is a constant, not a variable.

    Just like e.g. "42++" doesn't work because there's nowhere to store the result back. "42+1", that does work, hence also "array+1" works and gives the address of the second element.
  • 0
    @Fast-Nop Thank you so much. I believe your explanation and it's good.
Add Comment