[C++ or C] I need this program working for C++ or C on Windows. Getting toomany errors. I don’t know

[C++ or C] I need this program working for C++ or C on Windows. Getting toomany errors. I don’t know which #include are needed either. #include
#include
#include
using namespace std; int main() {
ifstream infile;
string line; //for reading line from file string fileName = “FirstNames2015.txt”; // input file name
string searchName; // to store name to search
string boyName, girlName; // to store boy name & girlname
bool boyDone = false; // if a boy name is encountered or not
bool girlDone = false; // if a girl name is encountered or not // user input for name to be searched
cout
cin>>searchName; infile.open(fileName);
int rank = 1; // initializwe rank to 1 // open and real file
if (infile.is_open())
{
while (getline(infile, line)) {
// copy string line to character array str
char str[1024];
strcpy(str, line.c_str());
// now tokenise char array to get two names
char *pch;
// extract boy name
pch = strtok (str,” .,-“);
boyName = pch; // if boy name is not encountered already and it matches with aname in file
if (!boyDone && strcasecmp(boyName.c_str(),searchName.c_str())==0){
coutboyDone = true;
} // extract girl name
pch = strtok (NULL,” .’-“);
girlName = pch;
girlName = girlName.substr(0,girlName.length()-1);
// if girl name is not encountered already and it matches with aname in file
if (!girlDone && strcasecmp(girlName.c_str(),searchName.c_str())==0){
coutgirlDone = true;
} // if name found in both boys and girls name then return
if(boyDone && girlDone){
break;
}
rank++;
}
// if boy name was not found
if(!boyDone){
cout}
// if girl name was not found
if(!girlDone){
cout}
infile.close();
} else
{
cout }
return 0;
} Attached

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer