Hello everyone,
I have a problem when assigning value to an array of structures
for example let's declare the following structure;
typedef struct
{
float member;
}motor;
now the next step is to declare an array of of type
motor
motor joint[4];
now if i assign
member like this there is no problem;
joint[1].member = 10;
printf("%f", joint[1].member);
but if i assign
member through a function, the value is = 0.0
for example;
float calculate_torque(motor motor_array[], int index, some input)
{
float temp_value;
return temp_value;
}
Now, if i assign it like this
joint[1].member = calculate_torque(joint, 1,
printf("%f", joint[1].member);
the value still = 0.0;
I don't what is the problem, or what i am missing,
Thanks in advance,
z3ngew