Modified x_strcmp to take const char*
This commit is contained in:
parent
2f679ebfa3
commit
787bf40377
@ -32,9 +32,9 @@ void x_strcpy(char* dest, char* src, const int size_dest){
|
||||
// compare two strings
|
||||
// return 0 if equal to eachother
|
||||
// return -1 if not
|
||||
int x_strcmp (char* str1, char* str2){
|
||||
char* ptr1 = str1;
|
||||
char* ptr2 = str2;
|
||||
int x_strcmp (const char* str1, const char* str2){
|
||||
const char* ptr1 = str1;
|
||||
const char* ptr2 = str2;
|
||||
|
||||
while(*ptr1 != '\0' && *ptr2 != '\0'){
|
||||
if(*ptr1 != *ptr2){
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
int x_strlen(char*);
|
||||
void x_strcpy(char*, char*, const int);
|
||||
int x_strcmp(char*, char*);
|
||||
int x_strcmp(const char*, const char*);
|
||||
char* x_strconcat(char*, char*);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user