title: Converting c++ code into arduino with string and stream header files and functions
body: <p>I'm developing a project on my arduino board, for my projection of the idea I wrote the code in <code>C++</code>. But certain library files and functions weren't found on the arduino IDE which are found in <code>C++</code> to my knowledge.</p>
  
  <p>I'm attaching the code below.
  I want to convert the whole code into arduino in which only the <code>convertToEnglish</code> will remain as a function in the arduino .
  I tried replacing the header files and others functions with string library and other <code>Stream.h</code> header file but almost everything ended up in vain.
  Hence to over come this please quote me a solution.
  I tried using <a href="https://github.com/maniacbug/StandardCplusplus" rel="nofollow">Standard c++</a> as quoted but still the getline fucntion reports an error stating that the cin was not declared in scope.</p>
  
  <pre><code>#include &lt;StandardCplusplus.h&gt;
  #include &lt;system_configuration.h&gt;
  #include &lt;unwind-cxx.h&gt;
  #include &lt;utility.h&gt;
  
  
  
  #include &lt;iostream&gt;
   #include &lt;string&gt;
  #include &lt;sstream&gt;
  using namespace std;
  
   string convertToEnglish(string morse, string const morseCode[]);
  
  int main()
  {
  string input = "";
  cout &lt;&lt; "Please enter a string in morse code: ";
  getline(cin, input);
  
  string const morseCode[] = {".-", "-...", "-.-.", "-..", ".", "..-.",
  "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-",
  ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
  
  cout &lt;&lt; convertToEnglish(input, morseCode) &lt;&lt; endl;
  
  
  return 0;
  }
  
   string convertToEnglish(string morse, string const morseCode[])
   {
   string output = "";
   string currentLetter = "";
   istringstream ss(morse);
  
  size_t const characters = 26;
  
  while(ss &gt;&gt; currentLetter)
  {
      size_t index = 0;
      while(currentLetter != morseCode[index] &amp;&amp; index &lt; characters)
      {
          ++index; //increment here so we don't have to decrement after the loop like if we put in the condition
      }
  
      output += 'A' + index;
  }
  
  return output;
  }
  </code></pre>
  
  <p>error message:
  Arduino: 1.6.8 (Windows 8.1), Board: "Arduino/Genuino Uno"</p>
  
  <p>E:\brain\arduino\sketch_mar15a\Blink\Blink\Blink.ino: In function 'int main()':</p>
  
  <p>Blink:19: error: 'cin' was not declared in this scope</p>
  
  <pre><code> getline(cin, input);
  
           ^
  </code></pre>
  
  <p>exit status 1
  'cin' was not declared in this scope</p>
  
  <p>This report would have more information with
  "Show verbose output during compilation"
  option enabled in File -> Preferences.</p>