C++小白求教0.0
出现错误 Run-time.check Failure #2-stack around the variable 'link_id' was corrupted.程序如下:
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,e=0,i,j;
char s[3][10];
for(i=0;i<=2;i++)
{
cout<<"请输入第"<<i+1<<"行字"<<endl;
gets(s[i]);
for(j=0;j<10&&s[i][j]!='\0';j++)
{
if(s[i][j]>=65&&s[i][j]<=90) a++;
else if(s[i][j]>=97&&s[i][j]<=122) b++;
else if(s[i][j]>=48&&s[i][j]<=57) c++;
else if(s[i][j]==32) d++;
else e++;
}
}
cout<<"共有大写字母"<<a<<"个,小写字母"<<b<<"个,数字"<<c<<"个,空格"<<d<<"个,其他字符"<<e<<"个。"<<endl;
return 0;
}
为什么调试最后会出现 Run-time.check Failure #2-stack around the variable 'link_id' was corrupted.这样的错误呢……