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. [Message Deleted] [modified]

[Message Deleted] [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpperformancequestion
8 Posts 3 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.
  • G Offline
    G Offline
    GudduRanchi
    wrote on last edited by
    #1

    I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...? -- modified at 9:41 Wednesday 27th September, 2006

    R D 2 Replies Last reply
    0
    • G GudduRanchi

      I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...? -- modified at 9:41 Wednesday 27th September, 2006

      R Offline
      R Offline
      Rinu_Raj
      wrote on last edited by
      #2

      What is the error you are facing with struct XXXX{ CListmy_second_Struct; char buff[10]; char buff1[10]; }YYY; ?? Rinu Raj

      G 1 Reply Last reply
      0
      • G GudduRanchi

        I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...? -- modified at 9:41 Wednesday 27th September, 2006

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        GudduRanchi wrote:

        ...please help me

        With what? :confused: You've failed to indicate any problem.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        G 1 Reply Last reply
        0
        • D David Crow

          GudduRanchi wrote:

          ...please help me

          With what? :confused: You've failed to indicate any problem.


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          G Offline
          G Offline
          GudduRanchi
          wrote on last edited by
          #4

          I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...?

          D 1 Reply Last reply
          0
          • R Rinu_Raj

            What is the error you are facing with struct XXXX{ CListmy_second_Struct; char buff[10]; char buff1[10]; }YYY; ?? Rinu Raj

            G Offline
            G Offline
            GudduRanchi
            wrote on last edited by
            #5

            I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...?

            1 Reply Last reply
            0
            • G GudduRanchi

              I have created a structure as typedef struct __test{ char buf[10]; }TEST,*PTEST; then i created a CList object as CListmy_firststruct; then i am using to store linklist if( my_firststruct.IsEmpty()) my_firststruct.Addhead(pTest); else my_firststruct.AddTail(pTest); It is working fine. But problem start when i am using as typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; if(pTest->my_secondstruct.IsEmpty()) when i am trying to call this is giving me error error code is C0000005: This error is with memory. So how i will resolve this error. Can any one help me on this...?

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              I'm not sure what the problem is. This worked fine for me:

              typedef struct __Second
              {
              char buf[10];
              } SECOND, *PSECOND;

              typedef struct __test
              {
              CList< PSECOND,PSECOND> my_secondstruct;
              char buf[10];
              } TEST, *PTEST;

              PTEST pTest = new TEST;

              if (pTest->my_secondstruct.IsEmpty())
              ;


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "Judge not by the eye but by the heart." - Native American Proverb

              G 1 Reply Last reply
              0
              • D David Crow

                I'm not sure what the problem is. This worked fine for me:

                typedef struct __Second
                {
                char buf[10];
                } SECOND, *PSECOND;

                typedef struct __test
                {
                CList< PSECOND,PSECOND> my_secondstruct;
                char buf[10];
                } TEST, *PTEST;

                PTEST pTest = new TEST;

                if (pTest->my_secondstruct.IsEmpty())
                ;


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                G Offline
                G Offline
                GudduRanchi
                wrote on last edited by
                #7

                Hi What you have suggested it is good.it works fine but ? i am giving you total my problem. I am having two structure. as you kmow. typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; CListmy_example; i have created an object of PTEST as: PTEST test; Allocating an memory. Filled this structure. check (my_example.Isempty()){ // This is my First Node my_example.AddHead(test); } In this condition i am getting problem if i am alocating the memory of PTEST my_example= new TEST; them i am not able to call all the member variable of CList. So what i have to resolve my problem Regards and Thanks Neeraj Kumar Jha

                D 1 Reply Last reply
                0
                • G GudduRanchi

                  Hi What you have suggested it is good.it works fine but ? i am giving you total my problem. I am having two structure. as you kmow. typedef struct __Second{ char buf[10]; }SECOND,*PSECOND; typedef struct __test{ CListmy_secondstruct; char buf[10]; }TEST,*PTEST; CListmy_example; i have created an object of PTEST as: PTEST test; Allocating an memory. Filled this structure. check (my_example.Isempty()){ // This is my First Node my_example.AddHead(test); } In this condition i am getting problem if i am alocating the memory of PTEST my_example= new TEST; them i am not able to call all the member variable of CList. So what i have to resolve my problem Regards and Thanks Neeraj Kumar Jha

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  GudduRanchi wrote:

                  PTEST my_example= new TEST;

                  You can't do this because my_example is a CList object. The compiler should have warned you of such.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  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