n typedef struct double x y Point struct
Sign up to view full document!
SIGN UP
構造体のアクセス n 構造体のメンバは. 演算子を使う. . . typedef struct { double x, y; } Point; struct Point p 1 double x 1. 0 double y 2. 0 メンバ変数を読む int main(void) メンバ変数に代入する { Point p 1 = { 1. 0, 2. 0 }; printf("p 1=(%f, %f)n", p 1. x, p 1. y); p 1. x = -p 1. y; printf("p 1=(%f, %f)n", p 1. x, p 1. y); . . . 2015 -07 -06 出力 p 1=(1. 000000, 2. 000000) p 1=(-2. 000000, 2. 000000) C プログラミング入門 総機 1 (月1) 13
- Slides: 25