Top "Constants" questions

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

How do I define constant values of UIColor?

I want to do something like this, but I cannot get a cooperative syntax. static const UIColor *colorNavbar = [UIColor colorWithRed: 197.0/255.0 …

objective-c cocoa-touch constants uicolor
What are the INFINITY constants in Java, really?

I just recently ran across the constants in the primitive type wrapper classes like Double.POSITIVE_INFINITY and Double.NEGATIVE_…

java constants bits infinity
Dynamic constant name in PHP

I am trying to create a constant name dynamically and then get at the value. define( CONSTANT_1 , "Some value" ) ; // try …

php constants indirection
How to declare a constant Guid in C#?

Is it possible to declare a constant Guid in C#? I understand that I can declare a static readonly Guid, …

c# constants guid compile-time-constant
Objective C defining UIColor constants

I have a iPhone application with a few custom-defined colors for my theme. Since these colors will be fixed for …

iphone c objective-c constants globals
constexpr vs. static const: Which one to prefer?

For defining compile-time constants of integral types like the following (at function and class scope), which syntax is best? static …

c++ c++11 constants constexpr
Java constants in JSP

I have a class that defines the names of various constants, e.g. class Constants { public static final String ATTR_…

java jsp constants jsp-tags
Why do I get an error about the initializer not being a constant?

I am using the following code. const int X_ORIGIN = 1233086; const int Y_ORIGIN = -4728071; const int Z_ORIGIN = 4085704; const …

c constants initializer
How to use const in verilog

Instead of using module ... ( .. ) ; #15 endmodule I want use module ... ( ... ) ; // GateDelay is a const, like in c language const int GateDelay = 15 ; # …

constants verilog hdl system-verilog
C++ const in getter

I'm still learning about C++ and I'm reading everywhere that I have to use const everywhere I can (for speed …

c++ constants getter