Learn C Programming

Lesson 3 of 9 · Structures, Unions and Enums

Module 12 · Structures, Unions and Enums

Pointers to Structs and the Arrow Operator

Free with an accountReading

A delivery reaches Maria's shop: 25 more bags of rice. She writes a function called restock that adds them to the rice record. Inside the function, the stock reads 65. Back in main, it still reads 40.

Checking what this lesson needs for you…

What is inside Pointers to Structs and the Arrow Operator

  1. Maria's restock changed a copy
  2. A pointer to a struct
  3. The arrow operator
  4. Restock by pointer: the same program, changed in three places
  5. A read-only view with const
  6. Walking an array of records with a pointer
  7. By value, const pointer or pointer: how to choose