Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Further to all the answers provided so far, when using char array, String.indexOf() can be replaced by strstr(str1, str2). It return position number when str2 match part of the str1. Commented May 5, 2020 at 23:59
  • For learning, read `<cstring> that have all the function for c string and array manipulation that you need when handling char array. Commented May 6, 2020 at 0:20
  • @hcheung on this line "else if (strstr(request, "favicon.ico") == -1) {" I get "ISO C++ forbids comparison between pointer and integer [-fpermissive]" Commented May 6, 2020 at 11:27
  • I had to remove the comparison with 1 and -1 in both if statements to get it to compile. Commented May 6, 2020 at 11:30