hey guys, my code works and all, but my professor just told me that I need to include a .h file.
this program allows people to store numbers and contacts in a file and read it through the program in order to search through the contacts,
everything works, just wanted help he said he wanted me TO
design the user interface to get the desired information.
Is that what I already did? I think he wants a .h file help please
cout<<"Please enter the name of your file below (including .txt, .RTF....etc)"<<endl;
cout<<endl;
cin>>filename;
inFile.open(filename.c_str());
if (!inFile) OF
{cout<<"your file did not open"<<endl<<endl;}
if (inFile)
{
cout<<endl<<"How many contacts do you have in your file?"<<endl<<endl; //used for counter of loop storing struct arrays.
cin>>n;
cout<<endl<<"how would you like to search for your contacts?"<<endl<<"if by name press 0,"<<endl<<"or press any other number to search by Home Phone number:"<<endl<<endl;
cin>>choice;
if (choice==0)
{
i=0;
while(i<n) //
{ //
inFile >> List[i].lastName; //
inFile >> List[i].firstName;
inFile >> List[i].homePhone; //
inFile >> List[i].cellPhone; //
inFile >> List[i].officePhone; //
inFile >> List[i].pager; //
inFile >> List[i].faxNumber; //
//
i=i+1; //
//
//
}
i=0;
cout<<endl<<"enter The last name of the contact you are trying to reach"<<endl<<endl;
cin>>searchname;
i=0;
while (searchname!=List[i].lastName)
{i++;}