INFO: strtok() Needs No Additional Space to Insert NullsLast reviewed: September 4, 1997Article ID: Q71285 |
The information in this article applies to:
SUMMARYSometimes it is mistakenly assumed that when the C strtok() function inserts a null character ('\0') into the source string at the end of a token, the length of the source string increases by this new character. This is not the case because an additional character is not actually being inserted. Instead, the delimiter that strtok() found to indicate the end of the token is replaced by the null character. Thus, when declaring or allocating the string of tokens, you do not need to make allowances for the null characters to be inserted. Keywords : CRTIss kbfasttip Version : MS-DOS:5.1,6.0,6.00a,6.00ax,7.0; OS/2:5.1,6.0,6.00a; WINDOWS:1.0,1.5; WINDOWS NT:1.0,2.0,4.0,5.0 Platform : MS-DOS NT OS/2 WINDOWS |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |