[讨论]请你给出运行结果,并说明原因
#include<stdio.h>
#include<string.h>
int main()
{
int x = 10;
char c[10];
printf("%d\n", strlen( c ) );
strcpy( c, "1234567890987" );
printf("%d\n", x);
return 0;
}
#include<stdio.h>
#include<string.h>
int main()
{
int x = 10;
char c[10];
printf("%d\n", strlen( c ) );
strcpy( c, "1234567890987" );
printf("%d\n", x);
return 0;
}
2006-07-17 21:08
[此贴子已经被作者于2006-7-18 0:54:22编辑过]

2006-07-17 21:23
2006-07-17 21:51
2006-07-18 06:29
2006-07-18 06:45
strcpy和printf没有联系吧,有没有可能strcpy(c[x],.....) printf("%c",c[x]) 
2006-07-18 10:17
2006-07-18 10:36
最严重的问题是
strcpy( c, "1234567890987" );
由于这个极其严重的错误
使得
printf("%d\n", x);
也无法确定有确定的输出
这边的确有错误...但是请问.你哪来的肯定.说X的输出也无法确定...???

2006-07-18 10:46
2006-07-18 10:55

2006-07-18 10:58