AI-powered learning
Save this course
Secure Coding Practices in C++: A Deep Dive into const
Gain insights into the C++ keyword 'const,' its usage in various contexts, and implications when returning pointers and references. Learn about preventing accidental data changes.
5.0
49 Lessons
2h
Join 2.9 million developers at
Join 2.9 million developers at
LEARNING OBJECTIVES
- Use of const with variables
- Effect of const on functions and return types
- Const with parameters
- Relation between const and smart pointers
Learning Roadmap
2.
Arguments using const
Arguments using const
Get started with using const in arguments to enhance clarity, performance, and code robustness.
3.
Local Variables
Local Variables
3 Lessons
3 Lessons
Work your way through const local variables to enhance immutability and code clarity.
4.
Local Members
Local Members
8 Lessons
8 Lessons
Break down complex ideas about using `const` with member variables in C++ classes.
5.
Functions
Functions
6 Lessons
6 Lessons
Take a closer look at const functions, overloads, key takeaways, and practical exercises for secure coding in C++.
6.
Return Types
Return Types
7 Lessons
7 Lessons
Follow the process of managing const return types to avoid performance and safety issues.
7.
const Parameters
const Parameters
6 Lessons
6 Lessons
Maximize code clarity and safety with const in function parameters, avoiding unintentional modifications in C++.
8.
const and Smart Pointers
const and Smart Pointers
4 Lessons
4 Lessons
Get familiar with using `const` with smart pointers to enhance C++ coding practices.
9.
Rvalue References
Rvalue References
7 Lessons
7 Lessons
Discover the logic behind const rvalue references, key binding rules, and their practical usages.
Certificate of Completion
Showcase your accomplishment by sharing your certificate of completion.
Complete more lessons to unlock your certificate
Developed by MAANG Engineers
ABOUT THIS COURSE
In this course, you will learn about the C++ keyword const and its behaviour under different usage conditions, including local, global and static contexts. This course will help you to understand const and its implications when you attempt to return pointers and references in C++. By the end of the course, you will have a solid grip on const and its usage in preventing any accidental change of data.
ABOUT THE AUTHOR
Sandor Dargo
Principal engineer. Author. Speaker. Happy father.
Trusted by 2.9 million developers working at companies
A
Anthony Walker
@_webarchitect_
E
Evan Dunbar
ML Engineer
S
Software Developer
Carlos Matias La Borde
S
Souvik Kundu
Front-end Developer
V
Vinay Krishnaiah
Software Developer
Built for 10x Developers
No Passive Learning
Learn by building with project-based lessons and in-browser code editor


Personalized Roadmaps
The platform adapts to your strengths & skills gaps as you go


Future-proof Your Career
Get hands-on with in-demand skills


AI Code Mentor
Write better code with AI feedback, smart debugging, and "Ask AI"




MAANG+ Interview Prep
AI Mock Interviews simulate every technical loop at top companies


Free Resources