Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main ()
- {
- char *str ="HTTP/1.0 200 OK\n"
- "Date: Thu, 26 Apr 2012 20:57:31 GMT\n"
- "Server: Apache/2.2.16 (Debian)\n"
- "X-Powered-By: PHP/5.3.3-7+squeeze4ex1\n"
- "Vary: Accept-Encoding\n"
- "Content-Length: 88\n"
- "Connection: close\n"
- "Content-Type: text/html\n"
- "\n"
- "success\n";
- // 1. search for success:
- char *content = strstr(<stuff goes here>);
- // 2. Check for success vs fail
- if (content != NULL){
- // Content is now a string pointer with your content
- }
- else {
- // was a failure. :(
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment