Answer the question
In order to leave comments, you need to log in
What did I not understand with the functions from the string.h library?
#include <stdio.h>
#include <string.h>
int main(){
char string1[40];
char string2[40];
fgets(string1, 40, stdin);
fgets(string2, 40, stdin);
int i = strstr(string1, string2);
printf("Hello World!");
return 0;
}
Answer the question
In order to leave comments, you need to log in
All functions from the package return an int.
See documentation. Tyk
I will not say for everything, but usually functions from string.h return null, or a pointer to a cell. To get the cell number, you need to take their difference.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question