Top "Constants" questions

Constants in programming are definitions whose value is fixed throughout a program's execution.

Declaring a const double[] in C#?

I have several constants that I use, and my plan was to put them in a const array of doubles, …

c# static constants readonly
Object has type qualifiers that are not compatible with the member function

My class Game has a member EntityManager entityManager_. The class EntityManager has a private member Player player_ and the public …

c++ types constants compatibility qualifiers
why are java constants declared static?

Why are java constants declared static ? class Foo{ static final int FII = 2 ; } In this I understand the use of final? …

java static constants final class-variables
How do I remove code duplication between similar const and non-const member functions?

Let's say I have the following class X where I want to return access to an internal member: class Z { // …

c++ class constants code-duplication c++-faq
Compile-time constants and variables

The Java language documentation says: If a primitive type or a string is defined as a constant and the value …

java performance constants final compile-time-constant
Initialize static atomic member variable

I would like to generate identifiers for a class named order in a threadsafe manner. The code below does not …

c++ c++11 constants atomic
Javascript (ES6) const with curly braces

I'm new to ECMAScript 6, and while trying to learn Ember, I've seen the following code style occassionally: const { abc, def } = …

javascript ecmascript-6 constants
How do I use constants from a Perl module?

If I define a constant in a Perl module, how do I use that constant in my main program? (Or …

perl module export constants
cast unsigned char * (uint8_t *) to const char *

I've a function which take an uint8_t * argument : uint8_t* ihex_decode(uint8_t *in, size_t len, uint8_…

c casting constants avr-gcc
Why can't structs be declared as const?

They are immutable value types on the stack. What keeps me from having them a const? References: http://msdn.microsoft.…

c# struct stack constants