#include<stdio.h> int strlenn(char *string) { int length = 0; int i = 0; for (i = 0; i < 6; i++) { if (*string != ‘\0‘) { printf("%c", *string); } if(*string++!= ‘\0‘) { length += 1; } } return length; } int main() { char arr1[]="abcdef"; int num=strlenn(arr1); printf("\n%d", num); }
本文出自 “痕迹” 博客,请务必保留此出处http://wpfbcr.blog.51cto.com/10696766/1702647
原文地址:http://wpfbcr.blog.51cto.com/10696766/1702647