Address of PATH variable

I want to find the address of the PATH environment variable. What is the best way to go about finding that address? Does the address of the PATH variable ever change, or is it constant?

Using "getenv" is traditional.

Oh... Thank You but actually I meant the address in the memory space. I figured out a way as of now:

#include<stdio.h>
#include<unistd.h>
extern char **environ;

int main() {
        printf("environp: %p\n", environ);
}

But don't know if its right...

Now you have me worried, what are you going to do with it?

It was just that I was trying to figure out where exactly these are stored and who initializes them...

Sorry... posted by mistake...

And one more thing... When I'm trying the same on a Virtual Machine, the address doesn't change but it is giving me a constant address for the environment variable... Is there any specific reason for this?

Remember a process get's a virtual memory image, as if it's the only process on the machine.

I'm sorry but I'm still not clear about the idea. Could you please explain a little more?

And one more thing is that when I do it on a VM that runs Mandrake Linux with an older kernel it gives me a constant address.

Virtual memory - each process gets a completely new address space from top to bottom, program gets loaded at the bottom.

Next time program gets run, it gets a completely new address space from top to bottom, program gets loaded at the bottom.

That means the virtual address, say 20000000 to keep things simple, for each process gets mapped to a different physical address by the OS.

Examples:
process 2416 address 20000000 = real address 0x23456666
process 2082 address 20000000 = real address 0x12347777