字符串长度问题,对我打击老大了。。。刚学会了点指针。。。
程序代码:#include< stdio.h >
#include< stdlib.h >
void main()
{
int size_t( char *t );
char t[] = { 'a',' b', 'c', 'd' };
int l;
l = size_t( t );
printf( "%d",l);
system( "pause" );
}
int size_t( char t[] )
{
int length = 0;
for( ; *t++ !='\0';length +=1)
return length;
}为什么答案是4, 我的是0










