Hi, can anyone help me fix my code. This program is linked to a project list (with classes). This is the main program. It has to open up a file of strings and output then in order of how many there are. But its not working though. Can someone help me fix it up.
#include <iostream>
#include <fstream>
#include <string>
#include "IPlist.h"
using namespace std;
int main()
{
IPlist p;
string fileName;
ifstream infile;
cout << "Enter name of file : " << flush;
cin >> fileName;
infile.open(fileName.c_str());
if(infile >> IPaddress >> count)
{
if(!p.empty())
{
p.display();
}
}
if(!infile)
{
infile.clear();
cout << "Invalid file name" << endl;
}
system ("pause");
return 0;
}
Do I have to use my other class functions first? Like I have:
bool isPresent(string address)
updateCount(string address)
void display()
void insertInOrder(string address)