For example, to validate the valid Url, I'd 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] == '/') { // what should be in this something?
printf("The Url starts with http:// \n");
}
Or, I've thought about using strcmp(str, str2) == 0
, but this must be very complicated.
Is there a standard C function that does such thing?