title: I am making a function to print a dynamically allocated object array based on certain criteria in each element
body: <p>While working on an assignment, dealing with making classes, I have gotten a majority of the program written but I have to make two functions that print elements in an array based upon user input But I keep getting errors when trying to pass arguments to the function such as an eo167, I have tried looking but wasn't able to find anything on my problem. I tried just passing the dynamic array to the argument but it keeps saying "argument of type "Employee *" is incompatible with parameter of type "Employee **"   </p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  class Employee {
  private:
      int ID;
      string name;
      string depName;
      int salary;
  
  public:
      Employee();
  
      void setID(int newID) { ID = newID; }
      void setName(string newName) { name = newName; }
      void setDepName(string newDepName) { depName = newDepName; }
      void setSalary(int newSalary) { salary = newSalary; }
      int getID() { return ID; }
      string getName() { return name; }
      string getDepName() { return depName; }
      int getSalary() { return salary; }
      void print(Employee arr[], int n) {
          cout &lt;&lt; "Employees" &lt;&lt; endl;
          for(int i = 0; i &lt; n; i++) {
              cout &lt;&lt; ID &lt;&lt; " " &lt;&lt; name &lt;&lt; " " &lt;&lt; depName &lt;&lt; " " &lt;&lt; salary &lt;&lt; endl;
          }
      }
  };
  
  using namespace std;
  
  ifstream inFile;
  
  int main() {
      int employees;
      int id;
      int salar;
      string names;
      string dep;
  
      // for menu choice later
      int num;
  
      inFile.open("employees.txt");
  
      inFile &gt;&gt; employees;
      Employee* eArr = new Employee[employees];
  
      for(int i = 0; i &lt; employees; i++) {
          inFile &gt;&gt; id &gt;&gt; names &gt;&gt; dep &gt;&gt; salar;
  
          eArr[i].setID(id);
          eArr[i].setName(names);
          eArr[i].setDepName(dep);
          eArr[i].setSalary(salar);
      }
  
      inFile.close();
  
      cout &lt;&lt; "1) Print Employees" &lt;&lt; endl;
      cout &lt;&lt; "2) Print by Department" &lt;&lt; endl;
      cout &lt;&lt; "3) Print by Salary" &lt;&lt; endl;
      cout &lt;&lt; "4) Exit" &lt;&lt; endl;
  
      cout &lt;&lt; "What would you like to do?";
      cin &gt;&gt; num;
  
      if(num == 1) {
          eArr-&gt;print(eArr, employees);
      }
  
      if(num == 2) {
          printSalary(eArr, employees);
      }
  
      if(num == 3) {
          printDepartment(eArr, employees);
      }
  
      return 0;
  }
  
  void printSalary(Employee* arr[], int m) {
      int salar2;
      cout &lt;&lt; "Salary?";
      cin &gt;&gt; salar2;
      for(int i = 0; i &lt; m; i++) {
          if(arr[i]-&gt;getSalary &gt;= salar2) {
              cout &lt;&lt; arr[i];
          }
      }
  }
  
  void printDepartment(Employee* arr[], int z) {
      string department;
      cout &lt;&lt; "department?";
      cin &gt;&gt; department;
      for(int i = 0; i &gt;= z; i++) {
          if(arr[i]-&gt;getDepName == department) {
              cout &lt;&lt; arr[i];
          }
      }
  }
  </code></pre>