Structs is an actively used design pattern. A composite data type (or record) declaration that defines a physically grouped list of variables to be placed under one name in a block of memory, allowing the different variables to be accessed via a single pointer.

?Years Old

Languages with Structs include c, ion

Example from c:

struct account {
  int account_number;
  char *first_name;
  char *last_name;
  float balance;

Example from ion:

{ first : "Tom" , last: "Riddle" }  // Structure with two fields
{"first":"Tom","last":"Riddle"}     // The same value with confusing style
{center:{x:1.0, y:12.5}, radius:3}  // Nested struct

Last updated August 9th, 2020

Edit Structs on GitHub