How Do I Get The Last Character Of A String In C ?
How Do I Get The Last Character Of A String In C ? To access the last character of a string in C, we first need to find the last character index using the strlen(str)-1 and pass it to the [] notation. The strlen() function returns the total number of characters in a given string.