模擬實現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
相關文章
相關標籤/搜索