Skip to content · ⁨Saltar al contenido⁩

Structs and typedef: . vs -> · ⁨Structs y typedef: . vs ->⁩

English

Grouping related data

  • A struct groups several values into one thing. A point has an x and a y; a rectangle has a width and a height.
  • Each value inside is called a member (or field). They can have different types.
  • Structs let you pass one tidy thing around instead of many loose variables.

Español

Agrupar datos relacionados

  • Un struct agrupa varios valores en una sola entidad. Un punto tiene x e y; un rectángulo tiene width y height.
  • Cada valor interno se llama miembro (o campo). Pueden tener diferentes tipos.
  • Los structs permiten pasar una cosa ordenada en lugar de muchas variables sueltas.

Un struct Point con x e y; se accede a un campo con . en el struct, o -> a través de un puntero

Handout · ⁨Material⁩

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP