i want do this pro that looks like phone index
but i have problems
and i dunno how to fix this
its console application - c++ source file
plz help me quikly
#include<iostream.h>
void main()
{
char names[10],n;
double tel[10],tel1;
int x,i,f=0,f1=0;
cout<<"1 - add new rec"<<endl;
cout<<"2 - search by tel"<<endl;
cout<<"3 - search by name"<<endl;
cout<<"4 - Exit"<<endl;
cin>>x;
switch(x)
{
case 1: addrec;break;
case 2: sertel;break;
case 3: sername;break;
case 4: exit;
default : cout<<"Error";break;
}
void addrec()
{
for(i=0;i<10;i++)
{
cout<<"Enter Name"<<endl;
cin>>name[i];
cout<<"Enter tel"<<endl;
cin>>tel[i];
}
}
void sertel()
{
cout<<"Enter tel you want search"<<endl;
cin>>tel1;
for(i=0;i<=9;i++)
if tel1==tel[i]
{cout<<name[i]<<endl;
f=1;
}
if f==0;cout<<"Not found"<<endl;
}
void sername()
{
cout<<"Enter name"<<endl;
cin>>n;
for(i=o;i<=9;i++)
if n==name[i]
{
cout<<te;[i]<<endl;
f1=1;
}
if(f1==0)cout<<"Not found"<<endl;
}
}