pointers

This is a discussion on pointers within the C++ Programming forums, part of the General Programming Boards category; how would you hook up two different types of pointers in a linked list, for example, i have one pointer ...

  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, 06:08 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 12:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21