So I had this program. It should print out true since ret is "Point", just that I got it from strstr, and I am comparing it to the string "Point". For some mysterious reason, they are not the same strings. What is going on? Here is the code:
#include <stdio.h>
#include <string.h>
#include <strings.h>
int main () {
char *ret;
ret = strstr("TutorialsPoint", "Point");
if (strcmp(ret,"Point")) {
printf("Strings are equal\n");
} else {
printf("strings are not equal\n");
}
printf("The substring is: %s\n", ret);
return(0);
}