how to print the value of a pointer from a structure
<p>The value contained in the pointer 'p' from the structure below is wrong printed and i can not find the way to print it right. What's the right code for it?
The code:</p>

<pre><code>#include &lt;stdio.h&gt;

struct my_struct{ //structure definition
    int a,*p;
};

int main(){

    my_struct var;
    var.a = 5;                  //variable definition
    var.p = &amp;(var.a);           //pointer gets address from variable
    printf("%d\n",var.p);       // the number 2686744 is printed instead of the number '5'

    return 0;
}
</code></pre>