returning pointer of template type function header

Discussion in 'C Programming' started by wiegmale, Jul 8, 2010.

  1. wiegmale

    wiegmale

    Joined:
    Jul 8, 2010
    Messages:
    2
    We are creating a array list class and making it a template.

    Code:
    template <class ItemType>
    class ArrayList
    ...
    
    typedef ItemType* pItemType;
    typedef pItemType* ppItemType;
    
    My function is returning an item of type pItemType. My syntax is wrong, but I'm not sure what it should be:

    Code:
    template <class ItemType>
    ArrayList<ItemType>::pItemType ArrayList<ItemType>::Add(pItemType anItem)
    
     
    wiegmale, Jul 8, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vijai Kalyan
    Replies:
    4
    Views:
    739
    Vijai Kalyan
    Nov 8, 2005
  2. ymost@hotmail.com
    Replies:
    2
    Views:
    554
    ymost@hotmail.com
    Dec 28, 2008
  3. Mark Piffer
    Replies:
    9
    Views:
    937
    luserXtrog
    May 15, 2009
  4. Javier Montoya
    Replies:
    4
    Views:
    589
    Ali_Raz
    Nov 20, 2010
  5. avasilev
    Replies:
    4
    Views:
    590
    avasilev
    Dec 22, 2011
Loading...

Share This Page