find last character in c array code example
Example 1: get last char string c
char fruit[5] = "apple";
printf("Last character : %c", fruit[strlen(fruit)-1]);
Example 2: c find last element in array
sizeof(array)/sizeof(array[0]) - 1
char fruit[5] = "apple";
printf("Last character : %c", fruit[strlen(fruit)-1]);
sizeof(array)/sizeof(array[0]) - 1