completion.cc 507 B

12345678910111213141516171819202122232425262728293031
  1. struct PointInTime
  2. {
  3. int point_before_time;
  4. double age_of_universe;
  5. char lifetime; // nobody will live > 128 years
  6. };
  7. struct Line
  8. {
  9. enum { RED_AND_YELLOW, PINK_AND_GREEN } colourOfLine;
  10. double lengthOfLine;
  11. };
  12. struct PointInTimeLine
  13. {
  14. PointInTime point;
  15. Line line;
  16. };
  17. static void what_is_the( PointInTimeLine* p )
  18. {
  19. p->line.colourOfLine = Line::
  20. p->line.colourOfLine = Line::PINK_AND_GREEN;
  21. }
  22. static void draw_a( Line l )
  23. {
  24. PointInTimeLine p = { .line = l };
  25. what_is_the( &p );
  26. }