Pointer points to struct pointer
Hi,
I made a program which can be compiled but not built and run.
The VC++ compiler said that it has unresolved external error.
Here is my code:
#include <stdio.h>
//pointer has pointers
void main()
{
struct int_pointers
{
int *ptr1, *ptr2;
};
struct int_pointers *point, ptrs; //create 2 objects.
point = &ptrs;
int i1 = 123, i2 = 87, i3 = 45;
*(*point).ptr1 = 12; //dereference point and use dot notation
point->ptr2 = &i2; //pointer points pointer
printf("i1 = %d, point->ptr1 = %d\n", i1, *(*point).ptr1); //12
printf("i2 = %d, point->ptr2 = %d\n", i2, *point->ptr2); //87
}
Anyone knows why?
Thanks
gogo