This method takes two strings, then first compares the length and then uses memcmp to compare them if the length is identical.
When compiling, it gives the following warning:Code:int strcomp(char, char); int strcomp(char s1, char s2) { int l1 = strlen(s1); int l2 = strlen(s2); if (l1 == l2) { return memcmp(s1, s2, l1); } else { return 0; } }
test.c:25: warning: passing argument 1 of ‘strlen’ makes pointer from integer without a cast
test.c:26: warning: passing argument 1 of ‘strlen’ makes pointer from integer without a cast
test.c:28: warning: passing argument 1 of ‘memcmp’ makes pointer from integer without a cast
test.c:28: warning: passing argument 2 of ‘memcmp’ makes pointer from integer without a cast
I've barely started looking at what pointers are yet, but I didn't think I "made" any pointers in this code.