構造体と関数があり、読み取った構造体へのポインタを返します。
typedef struct cal_t {
float xm;
float ym;
float xn;
float yn;
} cal_t;
struct cal_t *lld_tpReadCalibration(void);
他のどこかに、その構造体のインスタンスがあります。
struct cal_t cal;
次に、構造体のそのインスタンスの値を、ポインタが返される構造体の値に割り当てる必要があります。だから私が欲しいのは、cal.xmがlld_tpReadCalibration()内のcal->xmと同じ値であるということです。象徴的に:
struct cal_t cal;
cal = lld_tpReadCalibration();
しかし、もちろん、これは機能しません。
error: incompatible types when assigning to type 'volatile struct cal_t' from type 'struct cal_t *'
どうすればこれを思い通りに動作させることができますか?
ご協力いただきありがとうございます。