帮我看一下这个电话簿查找电话程序错在哪,c++的
#include<iostream>#include<cstring>
using namespace std;
struct Telrec
{
char name[20];
double telnumb;
};
int main()
{
struct Telrec contact[10]={
{"Linda",123456},
{"John",126463},
{"Jane",79883},
{"Susan",976597},
{"Paul",966589},
{"Peter",996080},
{"Steven",869790},
{"Becky",585790},
{"Shirey",689879},
{"Lily",585767}
};
struct Telrec * p ;
p=contact ;
char searcname;
cout<<"请输入要查找的姓名:";
cin>>searcname;
for(int i=0;i<10;i++)
{
if(p[i].name==searcname)
cout<<p[i].telnumb;
else return(NULL);
}
}