一、声明

1.1、声明

  1. struct fraction {
  2. int numerator;
  3. int denominator;
  4. };

1.2、赋值

  • 单一赋值 ```c struct fraction f1;

f1.numerator = 22; f1.denominator = 7;

  1. - 批量赋值
  2. ```c
  3. struct car {
  4. char* name;
  5. float price;
  6. int speed;
  7. };
  8. struct car saturn = {"Saturn SL/2", 16000.99, 175};