Thread: pointers

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    5

    pointers

    how would you hook up two different types of pointers in a linked list, for example, i have one pointer that contains information on a graduate student and another pointer that contains info on a undergrad student and i want to put them in the same linked list that i will sort by the name, thanks

  2. #2
    Registered User cody's Avatar
    Join Date
    Sep 2001
    Posts
    86

    Question

    Try a union?!

    Greetings
    cody
    #include "reallife.h"

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    155
    derive one class from the other or else derive both from a common class and then use a pointer to the base class in the list.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  2. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM