Changeset 777 for soft/giet_vm/giet_libs/string.h
- Timestamp:
- Feb 4, 2016, 6:25:22 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/string.h
r607 r777 9 9 #define _STRING_H 10 10 11 char * strcpy ( char * destination, const char * source ); 12 int strcmp ( const char * str1, const char * str2 ); 13 int strlen ( const char * str ); 11 //////////////////////////////////////////////////////////////////////////////////////// 12 // This function copies the source string to the dest string. 13 // It returns a pointer on the dest string. 14 //////////////////////////////////////////////////////////////////////////////////////// 15 char * strcpy(char * destination, const char * source); 16 17 //////////////////////////////////////////////////////////////////////////////////////// 18 // The strncpy() function is similar to strcpy, except that at most n bytes of src 19 // are copied. If there is no null byte among the first n bytes of src, the string 20 // placed in dest will not be null terminated. 21 //////////////////////////////////////////////////////////////////////////////////////// 22 char * strncpy(char * dest, const char * src, int n); 23 24 //////////////////////////////////////////////////////////////////////////////////////// 25 //The strcmp() function 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. 26 //////////////////////////////////////////////////////////////////////////////////////// 27 int strcmp(const char * str1, const char * str2); 28 29 //////////////////////////////////////////////////////////////////////////////////////// 30 // This function returns the number of characters in a string. 31 // The terminating NULL character is not taken into account. 32 //////////////////////////////////////////////////////////////////////////////////////// 33 int strlen(const char * str); 34 35 //////////////////////////////////////////////////////////////////////////////////////// 36 // The strchr() function returns a pointer to the first occurrence of the character c 37 // in the string s. 38 //////////////////////////////////////////////////////////////////////////////////////// 39 char * strchr(const char * str, int c); 14 40 15 41 #endif
Note: See TracChangeset
for help on using the changeset viewer.