Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to point to a list item

how to point to a list item

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hearties
    wrote on last edited by
    #1

    class CData { // members CData* pChildList; } CList* pDataList, pTempList; pTempList = pDataList->GetHead()->pChildList; //how to correct this line? How can I make pTempList to point to pChildList? :mad: :mad: :mad: :mad: :mad:

    T 1 Reply Last reply
    0
    • H hearties

      class CData { // members CData* pChildList; } CList* pDataList, pTempList; pTempList = pDataList->GetHead()->pChildList; //how to correct this line? How can I make pTempList to point to pChildList? :mad: :mad: :mad: :mad: :mad:

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Change 'class CData' to 'struct CData' or make pChildList a public member. Members of classes are private by default, while default struct members access is set to public. Tomasz Sowinski -- http://www.shooltz.com.pl

      H 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Change 'class CData' to 'struct CData' or make pChildList a public member. Members of classes are private by default, while default struct members access is set to public. Tomasz Sowinski -- http://www.shooltz.com.pl

        H Offline
        H Offline
        hearties
        wrote on last edited by
        #3

        the class CData is public alright?. the compiler gave this error msg: error C2582: 'operator =' function is unavailable :confused:

        T 1 Reply Last reply
        0
        • H hearties

          the class CData is public alright?. the compiler gave this error msg: error C2582: 'operator =' function is unavailable :confused:

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Change your variable declaration to:

          CList* pDataList, pTempList;

          to

          CList* pDataList, *pTempList;

          pTempList without asterisk declares object, not a pointer to an object. Tomasz Sowinski -- http://www.shooltz.com.pl

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups