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.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside Pointers to Structs and the Arrow Operator
- Maria's restock changed a copy
- A pointer to a struct
- The arrow operator
- Restock by pointer: the same program, changed in three places
- A read-only view with const
- Walking an array of records with a pointer
- By value, const pointer or pointer: how to choose