M
makc.the.great
I have this global table:
char t[256] = { 1, 3, 3, 4,... 7 };
would it be faster or slower with "static"?
char t[256] = { 1, 3, 3, 4,... 7 };
would it be faster or slower with "static"?
*-----------------I have this global table:
char t[256] = { 1, 3, 3, 4,... 7 };
would it be faster or slower with "static"?
Declaring the chars "const' could be faster and would definitely be
safer.
I have this global table:
char t[256] = { 1, 3, 3, 4,... 7 };
would it be faster or slower with "static"?
static in front of a global is (allmost) an error.
(for some compilers this means use internal linkages - but just don't
write static there)
tmartsum 写é“:
i don't agree with you,sometimes wo do need to use static global.
C++ has officially deprecated the use of static to indicate internal
linkage for a global variable. An unnamed namespace should be used for
this purpose. In other words, a declaration like this:
These are lookup tables for color transforms. I.e., if we haveaccess the objects in the array? Is there anything that is predictable?
you do calculate it somting like i*(1-r-b) ?i-r*i-b*i
Someone suggested char*="dlnitn". Could anyone else confirm if this is
faster?
const char *t = "\1\3\3\4....\7"
This will put the sting in codesegment and not the heap - do not know
if it is faster ....
no, index is same during table generation (it uses fact that R=G=Btmartsum said:If I understand you right then you are looking
at the same index in two tables.
tmartsum said:char* table = "blahbhla" is const by itself hence
table[0] = 'a' can crash
so the above versio of table is often "more" const than your example.
(Depends on compiler)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.