title: What am I doing wrong in this class?
body: <p>I have a problem when linking the <code>.cpp</code> and the <code>.h</code> files.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>cpp</strong></p>
  
  <pre><code>#include "Number.h"
  #include &lt;string.h&gt;
  
  Number::Number(const char* value, int baza)
  {
      val = new char[strlen(value)+1];
      memcpy(val, value, strlen(value) + 1);
      this-&gt;base = baza;
  }
  
  Number::Number(char* value, int baza)
  {
      val = new char[strlen(value) + 1];
      memcpy(val, value, strlen(value) + 1);
      this-&gt;base = baza;
  }
  
  Number::~Number()
  {
      delete val;
      val = nullptr;
  }
  
  Number operator+(Number&amp; i1, Number&amp; i2)
  {
      int x = char_to_10(i1.getVal(), i1.GetBase()) + char_to_10(i2.getVal(), i2.GetBase());
      cout &lt;&lt; x&lt;&lt;endl;
      int baza_mare = (i1.GetBase() &gt; i2.GetBase() ? i1.GetBase() : i2.GetBase());
      char* p = new char[10];
      p=SchimbaBaza(x, baza_mare);
      Number res(p, baza_mare);
      return res;
  }
  
  char* SchimbaBaza(int n, int newBase)
  {
      int i = 0; int p = 0; int v[1000];
      while (n)
      {
          v[i] = n % newBase;
          i++;
          p++;
          n = n / newBase;
      }
      int j = 0;
      char* aux = new char[p];
      for (i = 0; i &lt;= p; i++)
          aux[i] = NULL;
      for (i = p-1; i &gt;= 0; i--)
      {
          if (v[i] &lt;= 9)
              aux[j++] = (char)(v[i] + 48);
          else if (v[i] == 10)
              aux[j++] = 'A';
          else if (v[i] == 11)
              aux[j++] = 'B';
          else if (v[i] == 12)
              aux[j++] = 'C';
          else if (v[i] == 13)
              aux[j++] = 'D';
          else if (v[i] == 14)
              aux[j++] = 'E';
          else if (v[i] == 15)
              aux[j++] = 'F';
      }
      return aux;
  }
  
  void Number::SwitchBase(int newBase)
  {
      int i = 0; int p = 0; int v[1000];
      char aux[100];
      int n = char_to_10(getVal(), GetBase());
      while (n)
      {
          v[i] = n % newBase;
          i++;
          p++;
          n = n / newBase;
      }
      int j = 0;
      for (i = p; i &gt;= 0; i--)
      {
          if (v[i] &lt;= 9)
              aux[j++]= (char)(v[i]+48);
          else if (v[i] == 10)
              aux[j++]= 'A';
          else if (v[i] == 11)
              aux[j++] = 'B';
          else if (v[i] == 12)
              aux[j++] = 'C';
          else if (v[i] == 13)
              aux[j++] = 'D';
          else if (v[i] == 14)
              aux[j++] = 'E';
          else if (v[i] == 15)
              aux[j++] = 'F';
      }
  
      this-&gt;base = newBase;
      j = 0;
      for (j = 1; j &lt;=p; j++)
          cout&lt;&lt;aux[j];
      cout &lt;&lt; endl;
      for (j = 0; j &lt;p; j++)
          val[j] = NULL;
      for (j = 0; j &lt; p; j++)
          val[j] = aux[j+1];
  }
  
  char* Number::getVal()
  {
      return (this-&gt;val);
  }
  
  int Number::GetDigitsCount()
  {
      return (strlen(this-&gt;val));
  }
  
  int Number::GetBase()
  {
      return(this-&gt;base);
  }
  
  void Number::Print()
  {
      printf("Numarul nostru in baza %d este %s.\n", this-&gt;base, this-&gt;val);
  }
  
  int char_to_10(const char* text, int baze)
  {
      int x = 0;
      char * s = new char[strlen(text) + 1];
      memcpy(s, text, (strlen(text) + 1));
      for (int i = 0; i &lt; strlen(s); i++)
      {
          if (s[i] &gt;= '0' &amp;&amp; s[i] &lt;= '9')
              x = x + (s[i] - '0') * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'A')
              x = x + 10 * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'B')
              x = x + 11 * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'C')
              x = x + 12 * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'D')
              x = x + 13 * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'E')
              x = x + 14 * pow(baze, (strlen(s) - i - 1));
          if (s[i] == 'F')
              x = x + 15 * pow(baze, (strlen(s) - i - 1));
      }
      return x;
  }
  </code></pre>
  
  <p><strong>header</strong></p>
  
  <pre><code>#pragma once
  #include &lt;string.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  class Number
  {
      char* val;
      int base;
  public:
      Number(const char* value, int baza); // where base is between 2 and 16
      Number(char* value, int baza);
      ~Number();
  
      friend Number operator +(Number&amp; i1, Number&amp; i2);
      friend bool operator -(const Number&amp; i1, const Number&amp; i2);
      bool operator !();
      bool operator[](int index);
      bool operator&gt;(const Number&amp; i);
      Number(const Number&amp; i);
      Number(const Number&amp;&amp; i);
      bool operator--();
      bool operator--(int value);
  
      void SwitchBase(int newBase);
      void Print();
      char* getVal();
      int  GetDigitsCount(); // returns the number of digits for the current number
      int  GetBase(); // returns the current base
  };
  
  int char_to_10(const char* text, int baze);
  char* SchimbaBaza(int n, int newBase);
  </code></pre>
  
  <p><strong>main</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Number.h"
  using namespace std;
  
  int main()
  {
      Number n1("14A", 12);
      printf("Avem numarul de %d cifre in baza %d.\n", n1.GetDigitsCount(), n1.GetBase());
      n1.Print();
      //n1.~Number();
      //n1.SwitchBase(10);
      //n1.Print();
      printf("obiectul nostru are valoarea %s\n",n1.getVal());
      //n1.SwitchBase(10);
      //cout &lt;&lt; char_to_10(n1.getVal(), n1.GetBase());
      //cout &lt;&lt; endl;
      //n1.SwitchBase(10);
      //printf("obiectul nostru are valoarea %s\n", n1.getVal());
      Number n2("19A", 13);
      Number n3 = n1 + n2;    
  }
  </code></pre>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>LNK2019   unresolved external symbol "public: __thiscall Number::Number(class Number const &amp;&amp;)" (??0Number@@QAE@$$QBV0@@Z) referenced in function "class Number __cdecl operator+(class Number &amp;,class Number &amp;)" (??H@YA?AVNumber@@AAV0@0@Z)</p>
  </blockquote>