Hi guys,

I'm trying to create a function that will return the last element of an array. I am working in ANSI C.

I have no idea how to go about checking for the last element of the array.Code:char *top(void) { int i; /* Check for the last element */ for(i = 0; stack[i] != '\0'; i++) { } /* Return the last element of the array */ return ???; }

Help would be GREATLY appreciated!

Kind regards,

BuezaWebDev