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. memory problem!

memory problem!

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebuggingperformancehelp
6 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.
  • G Offline
    G Offline
    Gerald Mercet
    wrote on last edited by
    #1

    Hi everybody, Perhaps a simple question but, i would like to suggest it o you: In my application, i have an "access violation" message which appear to this following line: *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex), when i=0 and j=16, just with this indications, you will tell me to check if th e allocation is well done, but the problem is if i remove *(pInflex+i)- *pInflex (which is equal to 0), in the debug window, the following *(pHistoDBNorm+ j) is evaluated correctly whereas *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex), always in the debug window couldn't be evaluated (instead of reading a value which would have to be the same than *(pHistoDBNorm+ j), i could read something like that:"expression couldn't be read..." why?????? thanks in advance gerald

    J 1 Reply Last reply
    0
    • G Gerald Mercet

      Hi everybody, Perhaps a simple question but, i would like to suggest it o you: In my application, i have an "access violation" message which appear to this following line: *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex), when i=0 and j=16, just with this indications, you will tell me to check if th e allocation is well done, but the problem is if i remove *(pInflex+i)- *pInflex (which is equal to 0), in the debug window, the following *(pHistoDBNorm+ j) is evaluated correctly whereas *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex), always in the debug window couldn't be evaluated (instead of reading a value which would have to be the same than *(pHistoDBNorm+ j), i could read something like that:"expression couldn't be read..." why?????? thanks in advance gerald

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      All clues suggest that pInflex is invalid. Maybe you have freed it before time? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      G 2 Replies Last reply
      0
      • J Joaquin M Lopez Munoz

        All clues suggest that pInflex is invalid. Maybe you have freed it before time? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        G Offline
        G Offline
        Gerald Mercet
        wrote on last edited by
        #3

        i'm not sure because i have tested at the same time and both *pInflex and *(pInflex+i) have a correct value (equal to 0). i have seen it in the debug window!

        J 1 Reply Last reply
        0
        • G Gerald Mercet

          i'm not sure because i have tested at the same time and both *pInflex and *(pInflex+i) have a correct value (equal to 0). i have seen it in the debug window!

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          Wait! There's a typo in your expression, instead of

          *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex)

          it should be

          *(pHistoDBNorm+ j- (*(pInflex+i)- *pInflex**)**)

          Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          G 1 Reply Last reply
          0
          • J Joaquin M Lopez Munoz

            All clues suggest that pInflex is invalid. Maybe you have freed it before time? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

            G Offline
            G Offline
            Gerald Mercet
            wrote on last edited by
            #5

            Sorry just a little mistake in my answer: "both *pInflex and *(pInflex+i) have a correct value (equal to 15)", not really important i know, but..!

            1 Reply Last reply
            0
            • J Joaquin M Lopez Munoz

              Wait! There's a typo in your expression, instead of

              *(pHistoDBNorm+ j- *(pInflex+i)- *pInflex)

              it should be

              *(pHistoDBNorm+ j- (*(pInflex+i)- *pInflex**)**)

              Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

              G Offline
              G Offline
              Gerald Mercet
              wrote on last edited by
              #6

              you're right, sorry for this stupid mistake and thanks for your help

              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