1、 strlen函数的实现方式
int m_strlen(const char*s)
{
int r = -1;
if(s)
{
do {
r++;
} while(*s++);
}
return r;
}
2、 测试
PRINTF_HEAP_MEM("%d\n",m_strlen("1234567890"))
PRINTF_HEAP_MEM("%d\n",m_strlen("12345678901234567890"))
PRINTF_HEAP_MEM("%d\n",m_strlen("123456789012345678901234567890"))