[Info-vax] String handling, was: Re: C... the only winning move is not to play...
JF Mezei
jfmezei.spamnot at vaxination.ca
Sat Feb 15 15:31:53 EST 2014
On 14-02-15 08:44, Simon Clubley wrote:
> For example, I don't mentally think of "unsigned char buffer[80];" as
> being a fixed length string. I think of it as more like a Bounded_String
> but with a length indicated by a special character (0x00) instead of
> a explicit length.
In the early days, you would create a structure of fixed length strings
to create a "record" which would be read in one shot with the data
aligned to each field. (think about a C program reading data generated
by a cobol program).
The C program must then not assume that there is a null character at the
end of each string field and treat each character array as a fixed
length string with space padded to the right.
Although it is quite rare today to see such uses because of the use of
tab delimited fields or other methods to store variable length data,
fixed length fields used to be common.
More information about the Info-vax
mailing list