Hi Roger,
RS>MO> strncat(stringvar, &charvar, 1); is the answer. it copies one
haracter
RS>MO> from the string pointed by &charvar and then appends \0.
RS> Are you sure about the '\0' being appended? I know that
RS> strncpy does not append a NUL. I thought that the behavior
RS> was consistent across all the strnxxx functions.
According to my documentation (MS, Borland, IBM & Watcom), yes it is.
Unfortunately the behaviour is not consistant and there are subtle
differences between the behavior of strncat() and strncpy() which can
trap the unwary.
George
* SLMR 2.1a * All Trademarks acknowledged (just in case ).
--- Maximus/2 3.01
---------------
* Origin: DoNoR/2,Woking UK (44-1483-717905) (2:440/4)
|