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. Hw to use CArray template

Hw to use CArray template

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionjavadelphi
6 Posts 4 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.
  • O Offline
    O Offline
    Ozgur
    wrote on last edited by
    #1

    Hi , i was just trying to use CArray template and ooops it gave hundreds of errors.When i get rid of it it compiles.an anybody help me to fix it OK. what i added : I have a person class in another file. and the code to create CArray is: CArray m_PersonArray; what is the wrog with it?should i include some header files, just give this beginner a hint with greetings Özgür Bachelor of Control&Computer Engineering from IStanbul Technical University Worked with Delphi for 6 Months Worked with Java for 3 Months Now ,Working with MFC,VIsual C++6.0 and ADO

    B C L 3 Replies Last reply
    0
    • O Ozgur

      Hi , i was just trying to use CArray template and ooops it gave hundreds of errors.When i get rid of it it compiles.an anybody help me to fix it OK. what i added : I have a person class in another file. and the code to create CArray is: CArray m_PersonArray; what is the wrog with it?should i include some header files, just give this beginner a hint with greetings Özgür Bachelor of Control&Computer Engineering from IStanbul Technical University Worked with Delphi for 6 Months Worked with Java for 3 Months Now ,Working with MFC,VIsual C++6.0 and ADO

      B Offline
      B Offline
      Bob Groves
      wrote on last edited by
      #2

      Hi, You need to #include probably in stdafx.h for ease. Also you will need a copy constructor and operator= for your class yourclass(const yourclass& c) yourclasss& operator=(const yourclass& rhs) HTH Bob.

      B 1 Reply Last reply
      0
      • B Bob Groves

        Hi, You need to #include probably in stdafx.h for ease. Also you will need a copy constructor and operator= for your class yourclass(const yourclass& c) yourclasss& operator=(const yourclass& rhs) HTH Bob.

        B Offline
        B Offline
        Bob Groves
        wrote on last edited by
        #3

        oops, the name of the header you need is

        B 1 Reply Last reply
        0
        • B Bob Groves

          oops, the name of the header you need is

          B Offline
          B Offline
          Bob Groves
          wrote on last edited by
          #4

          darn this thing, it's... afxtempl.h

          1 Reply Last reply
          0
          • O Ozgur

            Hi , i was just trying to use CArray template and ooops it gave hundreds of errors.When i get rid of it it compiles.an anybody help me to fix it OK. what i added : I have a person class in another file. and the code to create CArray is: CArray m_PersonArray; what is the wrog with it?should i include some header files, just give this beginner a hint with greetings Özgür Bachelor of Control&Computer Engineering from IStanbul Technical University Worked with Delphi for 6 Months Worked with Java for 3 Months Now ,Working with MFC,VIsual C++6.0 and ADO

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Assuming that the class is called person you can do two things: One: This is how to create a CArray of 'person's

            CArray<person, person> m_PersonArray

            Two: you can ditch CArray for the dog it is and use STL :) Oh, use an ampersand (shift 7) and lt or gt for the < or > signs, or otherwise all you'll do is lose everything inbetween them, as it's parsed as a HTML tag. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.

            1 Reply Last reply
            0
            • O Ozgur

              Hi , i was just trying to use CArray template and ooops it gave hundreds of errors.When i get rid of it it compiles.an anybody help me to fix it OK. what i added : I have a person class in another file. and the code to create CArray is: CArray m_PersonArray; what is the wrog with it?should i include some header files, just give this beginner a hint with greetings Özgür Bachelor of Control&Computer Engineering from IStanbul Technical University Worked with Delphi for 6 Months Worked with Java for 3 Months Now ,Working with MFC,VIsual C++6.0 and ADO

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I think you should declare its as : CArray m_IntArray for integers and CArray m_PersArray for an array of CPerson structure or class:)

              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