C++ member variable pointers
<p>I am sure this is a basic question, but I keep receiving memory access errors when I think I am doing this correctly.</p>

<p>What I want to do:</p>

<pre><code>class A{
  string name;
  string date;
}

main{
  A *a = new A();
  a-&gt;name= someFunct();
  a-&gt;date= someFunct();

  B b;
}
class B{
  A *a;
  printf("%s", a-&gt;name); //retrieving data set in main
}
</code></pre>

<p>I essentially need to assign some overall settings in one class and want to be able to access those settings throughout the application in the most efficient way.</p>
