Pointers & References
Work with memory directly. Learn how pointers store addresses, how references create aliases, and when to use each for efficient parameter passing.
Lessons
1. Intro
Memory addresses and aliases
2. Memory Addresses
Understanding memory locations
3. The Address-of Operator
Using & to find addresses
4. What is a Pointer?
Variables that store addresses
5. Quiz: Pointer Basics
Pointer syntax
6. Pointer Declaration
Creating pointer variables
7. Dereferencing Pointers
Using * to get values
8. Quiz: Pointer Operations
Predict the output
9. Pointer Initialization
Using nullptr
10. Pointers and Arrays
Array names as addresses
11. Pointer Arithmetic
Adding to pointers
12. Quiz: Pointer Arithmetic
Understanding movement
13. What is a Reference?
Aliases for variables
14. Reference Declaration
Variable aliases
15. Quiz: Variable alias
Variable alias
16. References vs Pointers
Key differences
17. Quiz: References
Understanding aliases
18. Pass by Reference
Function parameter technique
19. Const References
Avoiding copies safely
20. Quiz: Variable alias
Variable alias
21. When to Use Pointers vs References
Choosing the right tool
22. Quiz: Pass by Reference
Function parameter behavior
23. Common Pointer Errors
Avoid common crashes
24. Memory Safety Basics
Safe pointer habits
25. Problem: Swap Two Numbers
Writing swap function
26. Quiz: Swap Implementation
Verify your approach
27. Problem: Sum Array Elements
Using pointer arithmetic
28. Problem: Find Maximum
Combining techniques
29. Quiz: Pointer Traversal
Avoiding errors
30. Problem: Modify via Pointer
Dereferencing practice
31. Problem: Count References
Multiple names scenario
32. Quiz: Reference Behavior
Predicting results
33. Problem: Safe Pointer Check
Preventing crashes
34. Problem: Array Reversal
Using two pointers
35. Quiz: Array Reversal
Understanding the algorithm
36. Problem: Reference Parameters
Computing several values
37. Problem: Const Correctness
Using const references
38. Quiz: Const References
Understanding restrictions
39. Problem - Presents
Tracking gift exchanges
40. Presents - The Idea
Inverting the mapping
41. Presents - Algorithm
Breaking down the solution
42. Presents - Implementation
Complete solution
43. Presents - Walkthrough
Following the execution
44. Lessons from Presents
summary
45. Quiz: Integer type
Integer type
46. Problem - Beautiful Matrix
Finding position in grid
47. Beautiful Matrix - The Idea
Counting steps in grid
48. Beautiful Matrix - Algorithm
Breaking down the solution
49. Quiz: Conditional execution
Conditional execution
50. Beautiful Matrix - Implementation
Complete solution
51. Lessons from Beautiful Matrix
summary
52. Section Recap
What we learned