wrote:
> Hi,
>
> I have a C program. I have compiled it uisng gcc and also avr-gcc. Now
> after compiling, I want to know the addresses of the two variables in
> my program. Is there any options that I can use to find that out? Is
> there any way at all to find that out? Someone told that it was
> possible but I am not able to find out.
If you want to display the adress of a variable from the program you
can use %p for printf format, e.g. printf("Address var1=%p,
var2=%p",&v1, &v2); (where v1 and v2 are your variables).
If you want to find the address of the variables in the compiled
program you may have a problem. Consider the case of a recursive
function. The local variables are going to be created at different
addresses with each recursive call.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)