DEV Community

Discussion on: I'm an Expert in Memory Management & Segfaults, Ask Me Anything!

Collapse
 
codemouse92 profile image
Jason C. McDonald

Yes. As long as the pointer points to a sector of memory which is within in allocated region of the program's heap memory, it is valid, and can be accessed and used.

However, be aware that there can be unpredictable problems if you read from uninitialized memory — memory which has been allocated, but no value assigned to it.