title: using namespace std; and vectors
body: <p>I am working on a project for my c++ class and although my code looks fine to me (a beginner) whenever I run it I get error C2065 undeclared identifier in almost every line. I have done my research and have a feeling it has something to do with using namespace std; but I am not sure. Any help would be greatly appreciated. </p>
  
  <p>The project is to create a vector that store a book list and then offer the user the ability to add a book to the list, display the list using an iterator, remove a book using an iterator, or store the data in an external file. Here is what I have so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include "bookColl.h"
  #include &lt;algorithm&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main()
  {
      vector &lt;string&gt; bookCollection;
      string book1, book2, book3;
  
      cout &lt;&lt; "Enter the first book in your book collection: " &lt;&lt; endl;
      getline(cin, book1);
  
      cout &lt;&lt; "\nEnter the second book in your book collection: " &lt;&lt; endl;
      getline(cin, book2);
  
      cout &lt;&lt; "\nEnter the third book in your book collection: " &lt;&lt; endl;
      getline(cin, book3);
  
      bookCollection.push_back(book1);
      bookCollection.push_back(book2);
      bookCollection.push_back(book3);
  
      vector &lt;string&gt; ::iterator myITER;
      vector &lt;string&gt; ::const_iterator cITER;
  
      double decide;
  
      do
      {
          int choice = 0;
          cout &lt;&lt; "What would you like to do?/n1.Add a book to your collection." &lt;&lt;
              "/n2.Display your book collection." &lt;&lt; "/n3.Remove a book from your collection" &lt;&lt; "/n4. Stop adding books and store the data in an external file" &lt;&lt; "/nChoose a number 1 through 4: " &lt;&lt; endl;
  
          if (choice == 1)
          {
              string addNew;
              addBook(&amp;addNew);
              bookCollection.push_back(addNew);
          }
  
          else if (choice == 2)
          {
              cout &lt;&lt; "Here are your books: " &lt;&lt; endl;
              for (cITER = bookCollection.begin(); cITER != bookCollection.end(); cITER++)
              {
                  cout &lt;&lt; *cITER &lt;&lt; endl;
              }
          }
  
          else if (choice == 3)
          {
              int removeBook;
              myITER = bookCollection.erase(bookCollection.begin() + removeBook);
              cout &lt;&lt; "enter the numbered book position for the book you would like to remove: " &lt;&lt;
                  "/n(The books in your book collection are labels for 0 up)" &lt;&lt; endl;
              cin &gt;&gt; removeBook;
              cout &lt;&lt; *myITER &lt;&lt; endl;
          }
  
          else if (choice == 4)
          {
              sort(bookCollection.begin(), bookCollection.end());
  
              ofstream bookFile;
              bookFile.open("BookCollection.txt", ios::out | ios::app);
              bookFile &lt;&lt; " This is a line of text. \n";
              bookFile &lt;&lt; " This is a second line of text. \n";
              bookFile.close();
          }
  
          cout &lt;&lt; "\nWould you like to run this program again? If so select 1 for Yes, and 0 for No" &lt;&lt; endl;
          cin &gt;&gt; decide;
  
      } while (decide &gt; 0);
  }
  </code></pre>
  
  <p><strong>bookColl.h</strong></p>
  
  <pre><code>string addBook(string* pValOne);
  </code></pre>
  
  <p><strong>bookColl.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include "bookColl.h"
  
  using namespace std;
  
  string addBook(string* pValOne)
  {
      string newBook;
      *pValOne = newBook;
      cout &lt;&lt; "What is the name of the book you would like to add?" &lt;&lt; endl;
      getline(cin, *pValOne);
      return newBook;
  }
  </code></pre>