I want to do something that seems pretty simple. I get the results, but the problem is that I have no way of knowing if the results are correct.
I work in C and I have two pointers; I want to print the contents of a pointer. I donβt want to play the pointer to get the specified value, I just want the pointer to be stored.
I wrote the following code, and I need to know if this is correct, and if not, how can I fix it.
const Emp* emp1 = (const Emp*) item1; printf("\n comp1-> emp1 = %p; item1 = %p \n", emp1, item1 );
While I am posting this (and the reason why it is important that it is correct), I should end up doing this for a pointer to a pointer. I.e:
const Emp** emp1 = (const Emp**) item1;
c pointers memory-address
Frank V Jun 28 '09 at 22:48 2009-06-28 22:48
source share