For example, to check a valid Url, I would like to do the following
char usUrl[MAX] = "http://www.stackoverflow"
if(usUrl[0] == 'h'
&& usUrl[1] == 't'
&& usUrl[2] == 't'
&& usUrl[3] == 'p'
&& usUrl[4] == ':'
&& usUrl[5] == '/'
&& usUrl[6] == '/') {
printf("The Url starts with http:// \n");
}
Or, I was thinking about using strcmp(str, str2) == 0, but it should be very difficult.
Is there a standard C function that does such a thing?
source
share