摘要: 使用库函数strlen 1 lenght = strlen(str); 这种方法只适用于字符串数组 使用while循环遍历计数 1 2 int i=0; while(str[i++] != '\0'); 这种方法适用于计算数组中实际元素多少 利用sizeof函数计算地址 1 len = sizeof 阅读全文
posted @ 2020-10-24 15:47 vv彭 阅读(20530) 评论(1) 推荐(1)