I want to extract the base name from a string, like
/opt/home/etc/sample
That is, I want to parse a string of large length returning sample, or the substring
after the last / character. The string can be of any length.
How could this be done?
You can use strtok_r
P.S please check the code for some small errors