c++ - Program address range -


when write simple program using c / c++ , what's address range get? mean, can point wherever want.. :

void* ptr = (int*)0xffffffff; 

where pointer point to? guess not real address in main memory "cover" address of program.

can explain me? what's address range (in windows example) when running own c program? can access other program's address range if want to?

thanks!

your program runs in virtual address space, , pointers point locations within virtual memory. no, cannot expect conjure pointer same numeric value 1 in program , have them both point same actual memory. on contrary, if program crash or otherwise misbehave (but beware: it's undefined behavior, happen , it's platform-dependent).


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -