I have read at least a dozen articles on %p now and I'm still not getting a clear answer on this. I realize there are multiple posts on this on the site and I read a good number of them. I even read this article, but it did not explain it adequately
Say I have:
int x = 10;
void *p = &x;
does the below statement print out the address of 'p' or the address of 'x'?
printf( "Here: %p\n" , p );
I am trying to get the address of x through p.
For some context, I am iterating up the stack looking for pointers pointing into a linked list I created:
void foo(){
register void* base asm("ebp");
void* iter = base;
void* mBase = MAIN_BASE; //global defined as "register void* base asm("ebp")" in main function
void* start = &head;
void* fin = &tail + sizeof( tail );
while( iter != mBase ){
if( iter >= start && iter <= fin )
fprintf( stdout, ">>>>%p\n", iter );
printf("iter: %p\n", iter );
iter = (void*)( (char*)iter + 1 );
}
}