can anyone tell me how i would detect if "http://" was the first part of a string?
eg "http://example.com" would be detected however "example.com" would not
thanks
can anyone tell me how i would detect if "http://" was the first part of a string?
eg "http://example.com" would be detected however "example.com" would not
thanks
The standard library is your friend. strstr
Quzah.
Hope is the first step on the road to disappointment.
yes, but what if they enter "exahttp://ple.com" http still their but was not detected first, how can i make it so it has to be first, any ideas?
Code:char a[] = "exahttp://ple.com"; char *s; s = strstr(a,"http"); if(s == a) { // found it at first printf("got it!\n"); } else { //( found it but not at first ) or not in a printf("No\n"); }
Last edited by Bayint Naung; 03-27-2011 at 07:37 AM.