From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/FUNCTIONS/strtok.html | 100 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 reference/C/FUNCTIONS/strtok.html (limited to 'reference/C/FUNCTIONS/strtok.html') diff --git a/reference/C/FUNCTIONS/strtok.html b/reference/C/FUNCTIONS/strtok.html new file mode 100644 index 0000000..4d15b2f --- /dev/null +++ b/reference/C/FUNCTIONS/strtok.html @@ -0,0 +1,100 @@ +strncpy function + + + + + + +
+
+

strtok function

+
+
+

+All the books that I have read, say that strtok will break a string +into tokens. This is true, but a more obvious +explanation is, that it will break a string into words. +

+


+
+
+Library:   string.h
+
+Prototype: char * strtok(char *s, const char *delim);
+
+Syntax:	   char string []="abc def ghi";
+	   char * word;
+
+	   word=strtok(string, " ");
+	   word=strtok(NULL, " ");
+
+
+ +strtok requires a string and the word delimiters, for example: + +
+
+	   word = strtok(string, " ");
+	                   A      A
+	                   |      |
+	                   |	  -------  Delimiters.
+	                   |
+	                   --------------  String to break up.
+
+
+After the first call to strtok, word will point to abc on the second +call, word will point to def +

+


+

Notes:

+ +
+

Examples:

+ + Example program. +
+

See also:

+
strcpy +
strncpy + + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + -- cgit v1.2.3-54-g00ecf