title: Accessing a member of an object void pointer c++
body: <p>I have an assignment where I have to use a linked list of node with void* as the data. I would be filling the nodes with an object. I want to know some way of accessing the members of the object after it is in the linked list, other than casting it to the class. Is it possible? Also, here's a chunk of my code just in case it helps clarify my question.</p>
  
  <pre><code>struct Node
  {
      void* data_;
      Node* next_;
  
      Node()
      {
          data_ = 0;
          next_ = 0;
      }
  };
  
  class Star
  {
  private:
      char name_[ENTRY_SZ];
      long temperature_;
      double luminosity_;
      double mass_;
      double radius_;
  
  public:
      static char filePath_[ENTRY_SZ];
  
      Star(char* name);
      void SetTemperature(char* temp);
      void SetLuminosity(char* lum);
      void SetMass(char* mass);
      void SetRadius(char* rad);
      void PrintToConsole();
      void AppendToFile();
  };
  </code></pre>
  
  <p>I want to be able to call the PrintToConsole function after it is in a void*.</p>