P
pereges
#include <stdio.h>
typedef struct
{
double x, y, z;
}vector;
int main(void)
{
int i;
vector v;
double *cord;
v.x = 10;
v.y = 1;
v.z = 2;
cord = &v.x;
for(i = 0; i < 3; i++)
{
printf("%f\n", cord);
}
return 0;
}
here's the output i get:
10.000000
1.000000
2.000000
which is the same as v
i don't how it happens as i was just trying some random ideas but
great stuff really. helped me to reduce some of my code to almost
1/3rd its size.
typedef struct
{
double x, y, z;
}vector;
int main(void)
{
int i;
vector v;
double *cord;
v.x = 10;
v.y = 1;
v.z = 2;
cord = &v.x;
for(i = 0; i < 3; i++)
{
printf("%f\n", cord);
}
return 0;
}
here's the output i get:
10.000000
1.000000
2.000000
which is the same as v
i don't how it happens as i was just trying some random ideas but
great stuff really. helped me to reduce some of my code to almost
1/3rd its size.