[Info-vax] C str calls
mcleanjoh at gmail.com
mcleanjoh at gmail.com
Sun Aug 23 18:25:40 EDT 2015
On Monday, August 24, 2015 at 4:43:26 AM UTC+10, JF Mezei wrote:
> C is like a knife.
>
> When you don't know about its dangers, you get finger cuts as you handle
> knife or try to wash it.
>
> When you know how to handle the knife, you know how to handle it so that
> you don't get cut, including how you can slide your fingers on it to
> wash it and not get cut.
IIRC someone, maybe here, advocated a form of string descriptor for C so that issues of length were easier to deal with - pass the address of the descriptor as an argument rather than the pointer to the string and, separately, the string length.
I'm thinking that the descriptor holding not just maximum length but also current length might be useful, of course with a pointer to the string.
More information about the Info-vax
mailing list