1
0xTJ
7y

I don't know what's happening. In passing a char pointer to a function. I'm having issue, so I'm printf'ing the address pointed to by the pointer. Right after I assign it, it contains the right address, but the printf on the next line has it containing a different address. Another printf shows another different value, but all the following printfs show that third value. They're all consecutive printfs with nothing happening in between in the program, and the char* starts it's life as an array. All compiler optimizations are disabled. I don't know what's happening, it's just randomly changing. 😭

Comments
  • 0
    Are you doing any threading or other weird stuff?
  • 0
    @jaread Nope, very simple program. Nothing complicated happening, nothing should be messing with that memory
Add Comment