B
Boris Gambon
Hi
I'm looking for an efficient way to store, read and convert strings.
The strings and string sizes are known at compile time, but they are
not constant. A large number of strings should be decoded and then
referenced through an [n] array.
The executable size should be small and the overhead during runtime
should be small as well (high speed).
There may be nuls inside this char array. Even so, each string should
be nul terminated. Rather than using nuls to indicate the end of
strings, perhaps it's efficient to provide another char array, each
element of which contains the size of the string (limited to 256
chars). Pointers can be created and set by adding offset to the
previous pointer, starting with the beginning of the char [] array.
Using int's in stead of chars would make the array for pointers to
each string 4 times larger.
Is this a good method or are there better methods? How can this be
implemented as efficiently as possible in terms of executable size and
processing speed?
Thanks!
I'm looking for an efficient way to store, read and convert strings.
The strings and string sizes are known at compile time, but they are
not constant. A large number of strings should be decoded and then
referenced through an [n] array.
The executable size should be small and the overhead during runtime
should be small as well (high speed).
There may be nuls inside this char array. Even so, each string should
be nul terminated. Rather than using nuls to indicate the end of
strings, perhaps it's efficient to provide another char array, each
element of which contains the size of the string (limited to 256
chars). Pointers can be created and set by adding offset to the
previous pointer, starting with the beginning of the char [] array.
Using int's in stead of chars would make the array for pointers to
each string 4 times larger.
Is this a good method or are there better methods? How can this be
implemented as efficiently as possible in terms of executable size and
processing speed?
Thanks!