title: Displaying strings in order - Exercise question
body: <p>So, i'm curently reading Bjarne Stroustrup's "Programming : Principals and practice using c++" and i'm at chapter 3. There is a question in the book which is "Write a program that prompts the user to enter 3 string values, and then outputs the values in order separated by commas. So, if the user enters the values "Steinbeck", "Hemingway", "Fitzgerald", the ouput should be "Fitzgerald, Hemingway, Steinbeck"".</p>
  
  <p>I am currently stuck at that question, I can't seem to make the programme work. I know how to output integers in numerical sequence, like with this code <a href="http://www.stroustrup.com/Programming/Solutions/Ch3/e3-6.cpp" rel="nofollow">http://www.stroustrup.com/Programming/Solutions/Ch3/e3-6.cpp</a> but I can't seem to modify that to make it work with string values (I get the error "fatal error LNK1120: 1 unresolved externals", and I wish to understand how to do so.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>ps: Here is the modified code of what is in the link, (which is my lame attempt at answering the question). And I know there are simpler ways of doing so, but i'm not there yet, it's in the next chapter (vectors):</p>
  
  <pre><code>#include "D:\Mes Documents\Visual Studio 2010\std_lib_facilities.h"
  
  int main()
  {
      string name1 = " ";
      string name2 = " ";
      string name3 = " ";
  
      cout &lt;&lt; "Please enter three names seperated by spaces: " &lt;&lt; endl;
      cin &gt;&gt; name1 &gt;&gt; name2 &gt;&gt; name3;
      if (!cin) error("Something went wrong with the read");
  
      string smallest = " ";
      string middle = " ";
      string biggest = " ";
  
      if (name1&lt;=name2 &amp;&amp; name1&lt;=name3)
      {
          smallest = name1;
          if (name2&lt;=name3)
          {
              middle = name2;
              biggest = name3;
          }
          else
          {
              middle = name3;
              biggest = name2;
          }
      }
      else if (name2&lt;=name1 &amp;&amp; name2&lt;=name3)
      {
          smallest = name2;
          if (name1&lt;=name3)
          {
              middle = name1;
              biggest = name3;
          }
          else
          {
              middle = name3;
              biggest = name1;
          }
      }
      else
      {
          smallest = name3;
          if (name1&lt;=name2)
          {
              middle = name1;
              biggest = name2;
          }
          else
          {
              middle = name2;
              biggest =name1;
          }
      }
  
      cout &lt;&lt; "The names in order are: " &lt;&lt; smallest &lt;&lt; " " &lt;&lt; middle &lt;&lt; " " &lt;&lt; biggest &lt;&lt; endl;
  
      system("pause");
      return 0;
  }
  </code></pre>