C Pointer Program to get the last name from a full name
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDK0ukFhcn_knNrLKJje-GgpoOyIcdiqs4pZya7YK8B919I_-bQK_3Qoar7m3JfgMNtChU8pk7ictjWUwjQRBqAyeXOfZv6V-xUyYHYWUsLs6maVNw9T-webkSmvZv_KgyLcD_-JlwOsml/w400-h278/c-language-logo3d.png)
C Language Flag / Logo Another C programming here, this article will simply explain how to do char array operation in C language to get the last word from a whole sentence, or in this case we just rename our function to be more specific to get a person last name from its full name. This is a very simple C function to get a user last name from a user full name. This function will do some pointer operation, so if you are trying to learn about pointer in C, this may help you little bit on understanding about a pointer in C: char * get_last_name(char * full_name) { char *last_name = full_name; int last_space=0; for(int i=0; i 0) last_space+=1; last_name += last_space; return last_name; } This function will loop through all the characters bit by bit and will try to find any spaces located on that character. If a space is found, then store the last space pointer location and return that pointer as its function return. - We define our function called get_last_name to