title: C++ use pointer to struct in function
body: <p>I am trying to us a pointer to a struct in C++. I have struct wSignal with member MAC. I give the pointer of a struct to the function.</p>
  
  <p>Definition struct:</p>
  
  <pre><code>struct wSignal
  {
      std::string MAC;
  };
  </code></pre>
  
  <p>using the function:</p>
  
  <pre><code>wSignal it1 = {"22:44:66:AA:BB:CC"};
  DoesPeriodExist(&amp;it1);
  </code></pre>
  
  <p>definition of the function:</p>
  
  <pre><code>bool DoesPeriodExist (wSignal&amp; s)
  {
     if(it1-&gt;MAC != "")
  }
  </code></pre>
  
  <p>Error I get:</p>
  
  <pre><code>error: base operand of ‘-&gt;’ has non-pointer type ‘wSignal’
  </code></pre>
  
  <p>What am I doing wrong? How can I use the pointer? Sorry if this is a silly questions. I am not very familiar with pointers and am trying the understand the concept.</p>