2019年7月12日 星期五

C : strrchr() analyze and example get self executable directory function.

strrchr() function will return a pointer to the last occurrence.
Another example is modify from Advanced Linux Programming chapter 11.We can get a sub-sting without the occurrence with sub two pointer.





Ref:
   1. http://www.cplusplus.com/reference/cstring/strrchr/
   2. Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel www.newriders.com

沒有留言:

張貼留言

Linux driver: How to enable dynamic debug at booting time for built-in driver.

 Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...