title: How to let a user add to and remove from "slots" in an array?
body: <p>I have a project in my C++ class - we're supposed to make a "simple student management system" comprised of a class for the student attribute variables, and a main function with a branch statement that lets the user input names and IDs for the students. I know that I need to use an array to make "slots" for the students, and that my branch statements need to let the user input values into those slots, but I'm not exactly sure how to do it. Here is the code that I have so far.</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;utility&gt;
  
  using std::string;
  using std::cin;
  using std::cout;
  using std::endl;
  
  struct Student {
  private:
      int id;
      string name;
      int birthday;
  public:
      Student()
      {
          id = 0;
          birthday = 0;
      }
      Student(int id, string name, int birthday)
      {
          //set your parameters to the class variables
          this-&gt;id = id;
          this-&gt;name = name;
          this-&gt;birthday = birthday;
      }
      void setID(int id)
      {
          this-&gt;id = id;
      }
      int getID() {
          return id;
      }
      void setName(string name)
      {
          this-&gt;name = name;
      }
      string getName()
      {
          return name;
      }
      void setBirthday(int birthday)
      {
          this-&gt;birthday = birthday;
      }
      int getBirthday()
      {
          return birthday;
      }
      void output() {
          cout &lt;&lt; id &lt;&lt; name &lt;&lt; birthday &lt;&lt; endl;
      }
  };
  
  int main() {
      Student arr[50];
      cout &lt;&lt; "Student Management System" &lt;&lt; endl;
      cout &lt;&lt; "Press 'a' to add a student" &lt;&lt; endl;
      char a = 1;
      int y = 1;
      while (a == 'a') {
          switch (y)
          {
              cout &lt;&lt; "Input Student ID:";
              cin &gt;&gt; id;
          }
      }
  }
  </code></pre>
  
  <p>What I'm focusing on most is the fourth line from the bottom. I was told that I need to use my setters, so I said that I want what my user inputs to be treated as the value of the ID variable that I set in the class. However, when I wrote this out, I was given an error. Could someone tell me what the issue is?</p>