11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Portabilitystrrchr con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See also strchr (page 313)strspnSynopsisDescriptionPortability#include size_t strspn(const char *s1, const char *s2);strspn computes the length of the maximum initial segment of the string pointed to bys1 which consists entirely of characters from the string pointed to by s2.strspn returns the length of the segment.strspn con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).strstrSynopsisDescription#include char *strstr(const char *s1, const char *s2);strstr locates the first occurrence in the string pointed to by s1 of the sequence ofcharacters (excluding the terminating null character) in the string pointed to by s2.strstr returns a pointer to the located string, or a null pointer if the string is not found.If s2 points to a string with zero length, strstr returns s1.Portabilitystrstr con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).strtokSynopsisDescription#include char *strtok(char *s1, const char *s2);A sequence of calls to strtok breaks the string pointed to by s1 into a sequence oftokens, each of which is delimited by a character from the string pointed to by s2. Thefirst call in the sequence has a non-null first argument; subsequent calls in the sequencehave a null first argument. The separator string pointed to by s2 may be different fromcall to call.The first call in the sequence searches the string pointed to by s1 <strong>for</strong> the first characterthat is not contained in the current separator string pointed to by s2. If no suchcharacter is found, then there are no tokens in the string pointed to by s1 and strtokreturns a null pointer. If such a character is found, it is the start of the first token.Chapter 28 - String handling317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!