When to use Struct instead of Hash in Ruby?

Viewed 20472

I don't have much programming experience. But, to me, Struct seems somewhat similar to Hash.

  • What can Struct do well?
  • Is there anything Struct can do, that Hash cannot do?

After googling, the concept of Struct is important in C, but I don't know much about C.

5 Answers
Related