title: bigInt addition and subtraction matters
body: <p>I am currently doing a school assignment (I am sorry that my question is about my assignment, but I am not asking about the algorithms used in the codes).  I am now currently doing the arithmetic part, addition and subtract.  Since there are only two operators, there are 8 combinations of operation.  In my program, I can do these four cases:</p>
  
  <p><code>（+a）+（+b）
  （-a）+（-b）
  （-a）-（+b）
  （+a）-（-b）</code></p>
  
  <p>However, I cannot figure out the way to do the other four cases, 
  I.e.</p>
  
  <p><code>（+a）+（-b）
  （-a）+（+b）
  （-a）-（-b）
  （+a）-（+b）</code></p>
  
  <p>I sincerely hope that you guys can provide suggestions and advice on how to deal with these four cases.</p>
  
  <p>Here is my code:</p>
  
  <p>linkedListType.h:
  It is a common linked list header file therefore I don't post the whole code here.</p>
  
  <p>bigInteger.h:
  The functions in this are quite long.  Therefore, I skipped posting them out.</p>
  
  <pre><code>#ifndef BIG_INTEGER_H
  #define BIG_INTEGER_H
  
  #include &lt;stack&gt;  
  #include &lt;iostream&gt;
  #include "linkedListType.h"
  
  using namespace std;
  
  class bigInteger
  {
  private:
      int sign;                       // set 0 for positive, 1 for negative
      linkedListType&lt;int&gt; digits;     // internal linked-list for storing digits in reverse order
  
  public:
      bigInteger();                           // default constructor
      bigInteger(const bigInteger&amp; other);    // copy constructor
  
      // Overload constructor
      // Use an numerical string to construct this bigInteger
      // For negative number, the first char in the string is '-'
      // e.g. "-12345"
      bigInteger(const string&amp; number);       
  
      // overload the assignment operator
      const bigInteger&amp; operator= (const bigInteger&amp; other);
  
      // Return a new bigInteger that is equal to *this + other
      // The contents of this and other should not be modified
      bigInteger&amp; operator+ (bigInteger&amp; other);
  
      // Return a new bigInteger that is equal to *this - other
      // The contents of this and other should not be modified
      bigInteger&amp; operator- (bigInteger&amp; other);
  
      // Print a big integer
      // Since the digits are stored in reverse order in the internal
      // list, you should print in reverse order
      // Print "undefined" if the digits list is empty
      friend ostream&amp; operator&lt;&lt;(ostream&amp; os, bigInteger&amp; n);
  };
  </code></pre>