How to use Free Functions with Objects
<p>I'm trying to find out/understand exactly how you access data of an object using free functions.</p>

<p>So my free functions look like this (header wise anyways):</p>

<pre><code>#ifndef CDSUPPORTFUN_H
#define CDSUPPORTFUN_H

void DisplayCDS(CDX *pCD1, CDX *pCD2, CDX *pCD3);
void ShowCosts(CDX &amp;CD1, CDX &amp;CD2, CDX &amp;CD3);
void MemoryReturn(CDX *pCD1, CDX *pCD2,CDX *pCD3);
#endif
</code></pre>

<p>Then I have the implementation for what each does. My question is, exactly what do I input into my Main.cpp to access these functions? What information must I pass in the Main.cpp when I call them?</p>

<p>For example, when I use:</p>

<pre><code>DisplayCDS(pCD1, pCD2, pCD3);
</code></pre>

<p>My data is displayed as intended. However is this still passing with a pointer? And how should it look if I am passing my reference?</p>

<p>--</p>

<p>EDIT: Since ShowCosts is passing by reference would the appropriate syntax to retrieve it be:</p>

<pre><code>CD1.ReturnCosts();
</code></pre>
