Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: AbstractBeliefs on Apr 28th, 2012  |  syntax: C++  |  size: 0.70 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main ()
  5. {
  6.   char *str ="HTTP/1.0 200 OK\n"
  7.               "Date: Thu, 26 Apr 2012 20:57:31 GMT\n"
  8.               "Server: Apache/2.2.16 (Debian)\n"
  9.               "X-Powered-By: PHP/5.3.3-7+squeeze4ex1\n"
  10.               "Vary: Accept-Encoding\n"
  11.               "Content-Length: 88\n"
  12.               "Connection: close\n"
  13.               "Content-Type: text/html\n"
  14.               "\n"
  15.               "success\n";
  16.  
  17.   // 1. search for success:
  18.   char *content = strstr(<stuff goes here>);
  19.   // 2. Check for success vs fail
  20.   if (content != NULL){
  21.     // Content is now a string pointer with your content
  22.   }
  23.   else {
  24.     // was a failure. :(
  25.   }
  26.   return 0;
  27. }