___雖然簡單,但好記性不如爛筆頭___
//得到字符串的長度(字節) //*str:字符串指針 //返回值:字符串的長度 unsigned char strlen(unsigned char *str) { unsigned char len=0; while(1) { if(*str=='\0')break;//拷貝完成了. len++; str++; } return len; }
___雖然簡單,但好記性不如爛筆頭___
//得到字符串的長度(字節) //*str:字符串指針 //返回值:字符串的長度 unsigned char strlen(unsigned char *str) { unsigned char len=0; while(1) { if(*str=='\0')break;//拷貝完成了. len++; str++; } return len; }
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。