Complile Issuer (memcmp, strcmp)
Posted: 23 Aug 2016 18:42
This is a simple issue that I would want to know about it.
int memcmp(void *s1, void *s2, int n);
void suppous void right? I can use any type so..
I suppose that i can compare char* with const char * pointer and to the contrary the compiler return is... Ilegal pointer.
Which is the right function to compare a string RAM memory with string ROM memory?
What about int strncmp(char *s1, char *s2, char len);
why I cant cast in this function ej:
char x[]="abdc";
const char y[]="abcdFGHI";
int strncmp(x, (char *)y, 4); //It in mikroC doesnot work.
Any idea? Regards
Alejandro
int memcmp(void *s1, void *s2, int n);
void suppous void right? I can use any type so..
I suppose that i can compare char* with const char * pointer and to the contrary the compiler return is... Ilegal pointer.
Which is the right function to compare a string RAM memory with string ROM memory?
What about int strncmp(char *s1, char *s2, char len);
why I cant cast in this function ej:
char x[]="abdc";
const char y[]="abcdFGHI";
int strncmp(x, (char *)y, 4); //It in mikroC doesnot work.
Any idea? Regards
Alejandro