Run-Time Check Failure #2 - Stack around the variable 'str1' was corrupted.
void String_yj()
{
#if 0
char str1[10];
char str[10];
#else
char str1[11];
char str[11];
#endif
int count; /* 循环体 */
for(count=0;count<11;count++)
{
str1[count] = 'a';
}
#ifdef DEBUG
str1[11]=0; /*结束标志*/
#endif
strcpy(str,str1);
#if 0
for(count=0;count<10;count++)
{
printf("数组str1[%d]为:%c",count,str1[count]);
printf("数组str[%d]为:%c",count,str[count]);
}
#else
printf("数组str1:%s\n",str1);
printf("数组str:%s\n",str);
#endif
return;
}
各路高手我运行时出现“Run-Time Check Failure #2 - Stack around the variable 'str1' was corrupted”是什么原因啊