Omgili - forum search, search forums  
  

Discussions about "constant

Displaying 1 - 10 out of 480,201 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I am trying to play fancy games which have the C++ compiler synthesize hash values of constant strings at compiletime. This would let me replace the string with a single identifier, with a massive savings in code size and complexity. For programming clarity...
Started by on , 4 posts by 4 people.  
I exploited that fact; printer(); return 0; } The relevant difference here is the difference between a "Integral Constant Expression" and a mere compile-time....
That the compiler optimiser does treat it as a character constant, pretty much.
I am trying to define a constant BUFFER_LENGTH for my class for a given usecase. //1. Using preprocessor declaration //#define BUFFER_LENGTH 12 //2.Global constant //const int BUFFER_LENGTH = 12; class MyRequest { public: //3. Define an in-class constant...
Started by on , 8 posts by 8 people.  
Read the constant out of the....
If the constant's meaning is entangled with the class, I would define to e.g.
An enumerate type is not meant to define a numeric constant, though it's (ab)used for that a lot in template-metaprogramming.
I'm using constants for output messages in different languages. For example, if a user chooses "English", a file with this constant would be required: define('welcomeMessage','Welcome!'); If she chooses "Spanish": define('welcomeMessage','Bien Venidos...
Started by on , 5 posts by 5 people.  
I would.
It doesn't make sense to use a constant if the value can be changed later.
With define() ).
Ask your Facebook Friends
Hello. I'm learning C++ and I'm still confused about this. What are the implications of return a value as constant, reference and constant reference in C++ ? For example: const int exampleOne(); int& exampleTwo(); const int& exampleThree();
Started by on , 9 posts by 9 people.  
Returning a constant value isn't a very common idiom, since you're;a; return this->a; } //return ....
They do not affect performance.
A particular instance of an object, and you understand the lifetime of the object Const / Constant.
Here is part of my code define('DIR_APP', 'app/'); class Questions { const QUESTIONS_FILE = DIR_APP . 'questions.xml'; } Seems when I take the define()'d constant out of my class constant declaration, it works fine. But when I add it it throws this error...
Started by on , 3 posts by 3 people.  
'questions.xml'; It can't be a constant expression, not (for example) a variable, a class member, result of a mathematical.
Const QUESTIONS_FILE = constant("DIR_APP") .
About trying this though...
I want to use a constant in php, but i also want to put it inside double quotes like a variable. Is this at all possible? define("TESTER", "World!"); echo "Hello, TESTER"; obviously outputs "Hello, TESTER", but what I really want is something like: $tester...
Started by on , 7 posts by 7 people.  
Use concatenation...? I've found that when dot-concatenation of a constant is a problem, using use a double quotes string the php can to process slowly; You don't use a constant into a string, because don't have any delimiter to the php....
Class My_class { const STATUS_ERROR = 0; const STATUS_OK = 1; const DB_TABLE = TABLE_PREFIX . 'class_table'; } The two status consts work fine and can be accessed within class methods as self::STATUS_ERROR and self::STATUS_OK just fine. The issue is one...
Started by on , 3 posts by 3 people.  
You can use a static property be defined with a constant value, they can't be the result of an expression http://www.phpbuilder.com.
You can't store anything in them.
Constants are constant.
You don't.
I have some existing code that I've used to write out an image to a bitmap file. One of the lines of code looks like this: bfh.bfType='MB'; I think I probably copied that from somewhere. One of the other devs says to me "that doesn't look right, isn't...
Started by on , 4 posts by 4 people.  
It probably depends.
Statement -- it's just a different way of expressing an integer constant.
I have a number of icons used throughout an application - let's take ok/cancel icons as an example. At the moment they might be a tick and a cross (tick.png, cross.png) but I may want to replace them in future. Also, I would like to keep the resource ...
Started by on , 6 posts by 6 people.  
Leave.
This way, you would only have to declare a new Icon constant, and the corresponding resource would be loaded automatically based on the name of the constant.
Public static Icon field in the class.
I want to do something like this: const MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string = MyFirstConstArray + ('Bar'); Basically I want the following result: MyFirstConstArray...
Started by on , 5 posts by 5 people.  
Is to ensure you declare your actual constant string only once, I suggest you declare the individual.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost