Friday 2 November 2018

java - How does Array indexing work?




Can someone explain array[++index] vs array[index++]?



I am reading a data structure book and it seems like this notation does have a difference.


Answer




array[++index] - which means increment to variable index in current statement itself.
array[index++] - which means increment to variable index after executing current statement.




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...