Question: help... it seems like .h file theres an error. can someone tell me what went wrong. The checkIFPresent went wrong. Please help me Phone.h :

help... it seems like .h file theres an error. can someone tell me what went wrong. The checkIFPresent went wrong. Please help me 

Phone.h :

#ifndef NAMESPACE_PHONE_H

#define NAMESPACE_PHONE_H

using namespace std;

namespace sdds

{

void phoneDir(const char* programTitle, const char* fileName);

bool checkIfPresent(char* name, string* partialName);

}

#endif

 phone.cpp #include  #include  #include "cStrTools.h" using namespace std; void phoneDir(const char* programTitle, const char* fileName) { cout << programTitle << "phone directory search "; cout << "------------------------------------------------------- "; while (1) { FILE *f = fopen(fileName, "r"); if (!f) { cout << fileName << " file not found! "; break; } else { cout << "Enter a partial name to search (no spaces) or enter '!' to exit >"; string partialName; cin >> partialName; if (partialName == "!") break; char name[50]; int area = 0, prefix = 0, number = 0; while (1) { // cout << "hey"; fscanf(f, "%[^\t]s", name); getc(f); fscanf(f, "%d", &area); getc(f); fscanf(f, "%d", &prefix); getc(f); fscanf(f, "%d", &number); if (getc(f) == EOF) break; // cout << name << " " << area << " "; if (checkIfPresent(name, partialName)) cout << name << ": (" << area << ") " << prefix << "-" << number << " "; } } fclose(f); } cout << "Thank you for using " << programTitle << " directory. "; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!