I have a below code in C:
#include <stdio.h>
#include <stdlib.h>
int main()
{
typedef struct sample {
int num;
} abc;
typedef struct exmp{
abc *n1;
} ccc;
abc *foo;
foo = (abc*)malloc(sizeof(foo));
ccc tmp;
tmp.n1 = foo;
ccc stack[10];
stack[0] = tmp;
printf("address of tmp is %p\n",&tmp);
// need to print address contained in stack[0]
return 0;
}
In the above code I want to check if the address at stack[0]
is same as address of tmp. How do I print address at stack[0]
as I printed out tmp's address?