For example, to validate the valid Url, I\'d like to do the following
char usUrl[MAX] = \"http://www.stackoverflow\" if(usUrl[0] == \'h\' && usUr
I would suggest this:
char *checker = NULL; checker = strstr(usUrl, "http://"); if(checker == usUrl) { //you found the match }
This would match only when string starts with 'http://' and not something like 'XXXhttp://'
'http://'
'XXXhttp://'
You can also use strcasestr if that is available on you platform.
strcasestr