The function strstr() returns a pointer to the first occurrence of x in a string.
It is also know as searching for a sub-string in a string.
Usage:
char * strstr ( const char *, const char * );
char * strstr ( char * str1, const char * str2 );
Return Value
A pointer to the first occurrence in str1 of any of the entire sequence of characters specified in str2. If nothing is found a null pointer is returned if the sequence is not present in str1.
More »
Posted in C Reference string.h Functions |
The function strrchr() returns a pointer to the last occurrence of x in a string.
Usage:
char *strrchr( const *str, int x);
Note: NULL will be returned if x isn’t found. More »
Posted in C Reference string.h Functions |
The function strncpy() copies up to n characters of one string to another string.
Usage:
char * strncpy( char * target, const char *source, size_t count); More »
Posted in C Reference string.h Functions |
The function strncmp() compares one string with another string up-to n characters.
Usage:
int strncmp( const char * target, const char * source, size_t count); More »
Posted in C Reference string.h Functions |
The strncat() function concatenates up to n characters of one string onto the end of another string.
Usage:
char *strncat(char *target, const char * source, size_t count); More »
Posted in C Reference string.h Functions |
The strlen() function returns the length of a string.
The length is determined by the number of characters before the null termination.
Usage:
size_t strlen(char *str)
strlen() source code example:
More »
Posted in C Reference string.h Functions |
The function strcpy() copies the characters from one string to another string.
Note: the null termination is also copied.
Usage:
char * strcpy( char *target, const char *source); More »
Posted in C Reference string.h Functions |
The function strcmp() compares one string with another string. The function strcmp() returns a integer value.
Usage:
int strcmp( const char * target, const char * source);
If the two strings are equal then zero is returned. More »
Posted in C Reference string.h Functions |
The function strchr() returns a pointer to the first occurrence of x in a string.
Usage:
char *strchr( const *str, int x);
Note: NULL will be returned if x isn’t found.
strchr() source code example:
More »
Posted in C Reference string.h Functions |
The strcat() function concatenates up to n characters of one string onto the end of another string.
Usage:
char * strcat ( char * destination, const char * source ); More »
Posted in C Reference string.h Functions |