Main Page   Compound List   File List   Header Files   File Members  

string.h File Reference

Generic string functions. More...


Functions

char* strcpy (char *dest, const char *src) NONBANKED
Copies the string pointed to be src (including the terminating `\0' character) to the array pointed to by dest. More...

int strcmp (const char *s1, const char *s2) NONBANKED
Compares the two strings s1 and s2. More...

void* memcpy (void *dest, const void *src, size_t len) NONBANKED
Copies n bytes from memory area src to memory area dest. More...

char* reverse (char *s) BANKED
Reverses the characters in the string. More...

char* strcat (char *s1, const char *s2) NONBANKED
int strlen (const char *s) NONBANKED
Calculates the length of the string, not including the terminating `\0' character.

char* strncat (char *s1, const char *s2, int n) NONBANKED
Concatenate s2 on the end of s1. More...

int strncmp (const char *s1, const char *s2, int n) NONBANKED
Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1<s2: <0.

char* strncpy (char *s1, const char *s2, int n) NONBANKED
Copy s2 to s1, truncating or null-padding to always copy n bytes. More...


Detailed Description

Generic string functions.

Function Documentation

char * strcpy (char * dest, const char * src)

Copies the string pointed to be src (including the terminating `\0' character) to the array pointed to by dest.

The strings may not overlap, and the destination string dest must be large enough to receive the copy.

Parameters:
dest   Array to copy into.
src   Array to copy from.
Returns:
A pointer to dest.

int strcmp (const char * s1, const char * s2)

Compares the two strings s1 and s2.

It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2.

void * memcpy (void * dest, const void * src, size_t len)

Copies n bytes from memory area src to memory area dest.

The memory areas may not overlap.

Parameters:
dest   Array to copy into.
src   Array to copy from.
len   The length in bytes of src.
Returns:
A pointer to dest.

char * reverse (char * s)

Reverses the characters in the string.

For example 'abcdefg' will become 'gfedcba'. Banked as the string must be modifiable.

char * strncat (char * s1, const char * s2, int n)

Concatenate s2 on the end of s1.

s1 must be large enough. At most n characters are moved.

char * strncpy (char * s1, const char * s2, int n)

Copy s2 to s1, truncating or null-padding to always copy n bytes.

If there is no \0 in the first n bytes of s2 then s1 will not be null terminated.


Generated at Sat Jul 22 11:34:02 2000 for gbdk-lib by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999