Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How to Declare a Constant in C++

NDC Conferences via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn the intricacies of declaring constants in C++ through this comprehensive conference talk that explores the surprisingly complex world of constant declarations. Discover the various approaches to defining constants, including global variables, local variables, static class data members, and templates, while understanding how to choose the most suitable method for your specific use case. Explore the nuances of linkage and storage duration, and master the proper use of specifiers such as static, inline, and constexpr in different scenarios. Examine when and how to use extern declarations and understand how constant declarations interact with C++ modules. Navigate through the complexities that make even simple constant declarations challenging in C++, gaining clarity on a topic that often confuses developers due to the language's flexibility and numerous options for achieving similar outcomes.

Syllabus

How to declare a constant in C++ - Mikhail Matrosov - NDC TechTown 2025

Taught by

NDC Conferences

Reviews

Start your review of How to Declare a Constant in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.