C
copx
Unforuntately, I know next to nothing about ASM and compiler construction,
and while I was aware of the syntactic differences between pointers and
arrays, I was not aware of this:
http://udrepper.livejournal.com/13851.html
(Yes, it is livejournal, but it is the journal of the glibc maintainer)
I am not sure I really understand this low-level difference between pointers
and arrays, and I do not have the time to learn ASM and compiler
construction (I am just a hobby coder). So I would like to ask you something
about this: one construct I use very often in my programs is an array of
constant strings, and after reading this I wonder whether:
const char foo_array[N_ENTRIES][ENTRY_SIZE] = {
"foo",
"bar"
};
translates to more efficient assembly than this:
const char * foo_array[N_ENTRIES] = {
"foo",
"bar"
};
One could argue that this is a platform specific question, but I would
really like to know the answer to this, and the people most likely to know
how to write efficient C code / how C compilers work are most likely to be
found here
copx
and while I was aware of the syntactic differences between pointers and
arrays, I was not aware of this:
http://udrepper.livejournal.com/13851.html
(Yes, it is livejournal, but it is the journal of the glibc maintainer)
I am not sure I really understand this low-level difference between pointers
and arrays, and I do not have the time to learn ASM and compiler
construction (I am just a hobby coder). So I would like to ask you something
about this: one construct I use very often in my programs is an array of
constant strings, and after reading this I wonder whether:
const char foo_array[N_ENTRIES][ENTRY_SIZE] = {
"foo",
"bar"
};
translates to more efficient assembly than this:
const char * foo_array[N_ENTRIES] = {
"foo",
"bar"
};
One could argue that this is a platform specific question, but I would
really like to know the answer to this, and the people most likely to know
how to write efficient C code / how C compilers work are most likely to be
found here
copx