In C, is there a good way to define length first, Pascal-style strings as constants, so they can be placed in ROM? (I\'m working with a small embedded system with a non-GCC
GCC and clang (and possibly others) accept the -fpascal-strings
option which allows you to declare pascal-style string literals by having the first thing that appears in the string be a \p
, e.g. "\pfoo"
. Not exactly portable, but certainly nicer than funky macros or the runtime construction of them.
See here for more info.