模拟实现strlen字符串长度(递归,非递归),strcpy字符串拷贝、strncpy(指定长度拷贝)、strcat(字符串拼接),strcmp(字符串比较)

strlen: #include<stdio.h> #include<windows.h> //模拟实现strlen 非递归 int mystrlen1(const char* str) { if (str == NULL) { return -1; } int count = 0; char*p = str; while (*p != '\0') { ++p; ++c
相关文章
相关标签/搜索