Hi,
just a quick question i have a function saving values into my struct, that all works but i do not know how to access these values in a different function to the one that saved them code is below.
typedef struct InputT{
double length;
double startingangle;
double angle;
} Input;
void input(){
Input input;
scanf("%lf", &input.lengt h);
scanf("%lf", &input.starting angle);
scanf("%lf", &input.angle );
return;
}
i wish to now access them in another function say to print
eg
Void print_from_stru ct{
printf("%lf", input.length);
return;
}
I know this dosnt work but i wish to do something like this any help would be great
Advanced thanks
Gilly
just a quick question i have a function saving values into my struct, that all works but i do not know how to access these values in a different function to the one that saved them code is below.
typedef struct InputT{
double length;
double startingangle;
double angle;
} Input;
void input(){
Input input;
scanf("%lf", &input.lengt h);
scanf("%lf", &input.starting angle);
scanf("%lf", &input.angle );
return;
}
i wish to now access them in another function say to print
eg
Void print_from_stru ct{
printf("%lf", input.length);
return;
}
I know this dosnt work but i wish to do something like this any help would be great
Advanced thanks
Gilly
Comment