struct
の本文開始の {
は struct
と同じ行に書く。struct
の初期化には初期化用関数を検討してみるstruct complex create_complex(double re, double im)
{
struct complex result = { x, y };
return result;
}
void init_complex_with_re(complex *c, double re)
{
c->re = re;
}
inline
関数が望ましい場合もある。