title: help with pointers and passing linked list as parameter, undefined reference c++
body: <p>I am getting an error message that says undefined reference to </p>
  
  <pre><code>encrypt(int, std::list&lt;int, std::allocator&lt;int&gt; &gt;*)
  </code></pre>
  
  <p>Here is how I am trying to use it:</p>
  
  <pre><code>decka = new list&lt;int&gt;;
    ifstream inF;
  
    inF.open(filename.c_str());
  
    if (inF.fail()){
      cerr &lt;&lt; "Error opening file" &lt;&lt; endl;
      exit(1);
    }
    int deckcount = 28;
    int card;
    for(int i = 0; i != deckcount; i++){
      inF &gt;&gt; card;
  
      decka-&gt;push_back(card);
    }
    inF.close();
  
    if(eorD == "e")
      convertM(message);
      int esize = message.length();
      convertToNum(message);
      encrypt(esize, decka);
  }
  </code></pre>
  
  <p>The error is coming from where I try and call encrypt.</p>
  
  <p>Here is the encrypt function:</p>
  
  <pre><code>void encrypt(int msize, list&lt;int&gt; *L){
  
    int jokeA = 27;
    int jokeB = 28;
  
    list&lt;int&gt;::iterator a = std::find(L-&gt;begin(), L-&gt;end(), jokeA);
    list&lt;int&gt;::iterator new_position = a;
    for(int i=0; i &lt; 1 &amp;&amp; new_position != L-&gt;begin(); i++)
      new_position--;
  
    L-&gt;insert(new_position, 1, *a);
  
    L-&gt;erase(a);
  }
  </code></pre>
  
  <p>And just so you can see how the class is defined here:</p>
  
  <pre><code>class DeckOps{
   public:
    DeckOps(string, string, string);
    ~DeckOps();
    string convertM(string);
    string convertToNum(string);
    void encrypt(int, list&lt;int&gt;*);
  
   private:
  
    list&lt;int&gt; *decka;
  
  };
  </code></pre>
  
  <p>My goal here is to be able to access elements of decka using my encrypt function.</p>