{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Processing Tokens

Processing Tokens - 9 Processing Tokens...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
9: Processing Tokens char *strtok(char *str, const char *sep); separates str into tokens, using characters from sep as separators. The first parameter str may be NULL (but not in the first call). The first call takes the non-null first parameter, and returns a pointer to the first token (skipping over all separators) All subsequent calls take NULL as the first
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
9: String-to-number Conversions double strtod(const char *s, char **p); long strtol(const char *s, char **p, int base); unsigned long strtoul(const char *s, char **p, int base); Convert a string s to a number. If the conversion failed: *p is set to the value of the original string s ,
Background image of page 2
9: Module for String Tokenizing Files often store data records using a delimited format; e.g. name|salary|id Here, the first field is a string, the second is a double, and the third is a long integer. For example:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
9: Interface of module token int construct_Token(const char *str, const char *delimiters); int destruct_Token(void); int hasMore_Token(); char *next_Token();
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}