Hello Mart.
21 Jan 98 19:00, Mart Oruaas wrote to Victor Kemp:
EL>> strcat(stringvar, &charvar);
MO> no, it does not work, because &charvar does not point to null-terminated
MO> string.
MO> strncat(stringvar, &charvar, 1); is the answer. it copies one character
MO> from the string pointed by &charvar and then appends \0.
Are you sure about the '\0' being appended? I know that
strncpy does not append a NUL. I thought that the behavior
was consistent across all the strnxxx functions.
-Roger
... E=Mc^5... nahhh...E=Mc^4... nahh...E=Mc^3... I give up.
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
|