Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Ada
X := Items'Last

X must be declared earlier.
int length = sizeof(items) / sizeof(items[0]);
int x = items[length - 1];

Only works if items has not decayed to a pointer.

length is defined as the size of the items array in bytes, divided by the size of its first element in bytes.

New implementation...