Fixed-width strings: Difference between revisions

Jump to navigation Jump to search
m
Line 73: Line 73:
We need to discuss whether strings should be 0-terminated. Processing a string buffer with C/C++ routines would be much easier if it did. Also, in debug mode, the display of a string is easier.
We need to discuss whether strings should be 0-terminated. Processing a string buffer with C/C++ routines would be much easier if it did. Also, in debug mode, the display of a string is easier.


''Question: can we use bit fields, or better masks plus shift for the compacted values?''
The listing uses bit fields, but I think that we should use masks and shifts to ensure the correct width and alignment of data, along with inline methods to access the fields.


  class String ... {
  class String ... {
55

edits

Navigation menu