title: Converting int to roman numerals, only end if zero entered
body: <p>I need to convert int to Roman numerals, my code is failing to compile with mingw using </p>
  
  <p>C:\code>g++ -Wall -o rome_to_int rome_to_int.cpp
  C:\Users\vm1\AppData\Local\Temp\ccSvDFll.o:task2.cpp:(.text+0x1278): undefined r
  eference to `get_int_ref_checked()'
  collect2.exe: error: ld returned 1 exit status</p>
  
  <p>Now as part of the code, it must keep asking for input, converting that input untill zero is entered. Once Zero has been entered then it can exit. </p>
  
  <p>I must use code from a privius question which covers the continuing untill which is found in the get_int_ref_checked, I can assume ONLY integers will be entered and nothing else, no doubles nor string of words. </p>
  
  <p>I'm not sure what else to check.  </p>
  
  <pre><code>#include &lt;iostream&gt; 
  #include &lt;string&gt; 
  #include &lt;sstream&gt;
  
  using namespace std; 
  int get_int_ref_checked();
  string int_to_ROMAN(); 
  
  
  
  /**
   Turns the number from 1 to 9
  */
  string digit_name(int digit)
  {  
     if (digit == 1) return "I";
     if (digit == 2) return "II";
     if (digit == 3) return "III";
     if (digit == 4) return "IV";
     if (digit == 5) return "V";
     if (digit == 6) return "VI";
     if (digit == 7) return "VII";
     if (digit == 8) return "VIII";
     if (digit == 9) return "IX";
     return "";
  }
  
  /**
   Turns the number 10, 20, 30, 40, 50, 60, 70, 80, 90
  */
  string ten_name(int n)
  {  
     if (n == 1) return "X";
     if (n == 2) return "XX";
     if (n == 3) return "XXX";
     if (n == 4) return "XL";
     if (n == 5) return "L";
     if (n == 6) return "LX";
     if (n == 7) return "LXX";
     if (n == 8) return "LXXX";
     if (n == 9) return "XC";
     return "";
  }
  
  /**
   Turns the number 100, 200, 300, 400, 500, 600, 700, 800, 900
  */
  string hun_name(int n)
  {  
  
     if (n == 1) return "C";
     if (n == 2) return "CC";
     if (n == 3) return "CCC";
     if (n == 4) return "CD";
     if (n == 5) return "D";
     if (n == 6) return "DC";
     if (n == 7) return "DCC";
     if (n == 8) return "DCCC";
     if (n == 9) return "CM";
     return "";
  }
  
  /**
   Turns the number 1000, 2000, 3000
  */
  string thou_name(int n)
  {  
  
     if (n == 1) return "M";
     if (n == 2) return "MM";
     if (n == 3) return "MMM";
  
     return "";
  }
  
  
  string int_to_ROMAN(int n)
  {
     int part = n; // The part that still needs to be converted 
     string roman; // The return value
  
     if (part &gt;= 1000)
     {  
        roman = thou_name(part / 1000);
        part = part % 1000;
     }
  
     if (part &gt;= 100)
     {  
        roman = roman + hun_name(part/100);
        part = part % 100;
     }   
     if (part &gt;= 10)
     {  
        roman = roman + ten_name(part/10);
        part = part % 10;
     }
  
     if (part &gt; 0)
     {
        roman = roman + digit_name(part);
     }
     return roman;
  }
  
  
  
  
  
  int main() 
  
  { 
  
   int n;
  
   string r;
  
  
   n = get_int_ref_checked();
  
   if (n == 0)
   {
  
    cout&lt;&lt; "The intput is ZERO! ";
  
   }
  
   if(n &gt; 0)
   {
  
   cout&lt;&lt; "The convert is " &lt;&lt; int_to_ROMAN(n); 
  
   } 
  
   return 0; 
  
  } 
  
  
  
  void get_int_ref_checked(int&amp; n) {
      for(;;) // infinite loop
      {
          cout&lt;&lt; "Please enter an integer\n";
          std::string inp;
  
          std::stringstream ss;
          ss &lt;&lt; inp;
          if( !(ss &gt;&gt; n) || n &gt;= 4000 || n &lt;= 0)
          {
              cout &lt;&lt; "Error enter a number n: 0 &lt; n &lt; 4000: \n";
          }
  
      }
  }
  </code></pre>