WeSearch

Symbolic Constant Conundrum

·3 min read · 0 reactions · 0 comments · 23 views
#programming#constants#c++#c#software-development
Symbolic Constant Conundrum
TL;DR · WeSearch summary

The article discusses the concept of symbolic constants in programming languages, particularly C and C++. It explains various methods for defining constants, including macros, enumerations, const, and constexpr. The author concludes by recommending the best practices for using these different types of constants in programming.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 2304) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Paul J. Lucas Posted on May 23 Symbolic Constant Conundrum #c #cpp Introduction A symbolic constant in any programming language is a name — a symbol — that can be used to stand in for a constant — a literal value. Programming languages inherited symbolic constants from mathematics that has many of them grouped by specific field of study. Examples include: π (pi), c (speed of light), e (Euler’s number), G (gravitational constant), h (Plank’s constant), etc.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)