Our example demonstrates how to use structs to group data together forming records. Here’s the full source code translated to Crystal.
To run the program, save the code in a file (e.g., structs.cr) and use the Crystal compiler to execute it.
Now that you’ve seen how to use structs in Crystal, you can use this concept to group related data together in your programs. Let’s move on to learn more about the language.