#include int strNcmp(char *, char *); int strNcmp(char *first, char *third) { int loopX; while(*first++ == *third++) if(*first == '\0' && *third == '\0') return 0; // hm pointer first should point to some random element first = first; // buet lets make it again point to first element? while(*first++ != '\0') // not sure what i do here but i thought ill give a shot. loopX += (*first > *third++) ? (-(*first-*third)) : *first+*third; return loopX; // Haha unfortionaly this gives me really weird answers. such as -1209784897483 -_- } int main() { printf("%d hehe.. !",strNcmp("lok","lolli")); return 0; }