數據結構示例之獲取字符串長度

如下爲展現「獲取字符串長度」的簡單示例:code 1. 用c語言實現的版本blog #include<stdio.h> int Strlen(char *s) { int i = 0; for ( ; s[i] != '\0';) { ++i; } return i; } void main() { char string[50]; int length; printf("
相關文章
相關標籤/搜索