title: a c++ function that enables input editing in a data structure
body: <p>I am designing a Logic Gate data structure in C++ called AND that has 3 functions:</p>
  
  <p>a function that takes input either 1 or 0 from the user.
  a function that shows output of AND Gate from the input.
  a function that asks user if they want to edit their inputs and if yes, then allows them to edit the inputs they have entered.
  Problem is that I cannot figure out how to call the function that edits input in the main. Following is my code.</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  struct AND  //structure called AND
  {
     int x, y;
  
     AND()    //constructor
     {
        x, y = 0;             //declaring variables as inputs
     }
  
     void inputAND()      //function that takes inputs from the user
     {
        cin &gt;&gt; x;
        cin &gt;&gt; y;
     }
  
     void outputAND()                       //function that displays output
     {
        if (x == 0 || y == 0)
        {
           cout &lt;&lt; "0" &lt;&lt; endl;
        }
  
        else if (x == 1 &amp;&amp; y == 1)
        {
           cout &lt;&lt; "1" &lt;&lt; endl;
        }
     }
  
     void changeInputAND(AND change[])       //function for changing inputs
     {
        cout &lt;&lt; "Do you wish change first input Yes/No:" &lt;&lt; endl;       
        string t;
        cin &gt;&gt; t;
        int k;
        if (t == "Yes" || "yes")
        {
  
           cout &lt;&lt; "Enter New Input ";
  
           cin &gt;&gt; k;
           x = k;
  
        }
        else
        {
           k = x;
        }
  
        cout &lt;&lt; "Do you wish to change the second input Yes/No:" &lt;&lt; endl;
        {
           string s;
           cin &gt;&gt; s;
           int l;
           if (t == "Yes" || "yes")
           {
              cout &lt;&lt; "enter new input";
              cin &gt;&gt; l;
              y = l;
           }
        }
     }
  };
  
  void main()
  {
     AND a1;
     a1.input();   //calling the input function
     a1.output();  //calling the output function
  }
  </code></pre>