let say we have this pointer called text it print this thing in this format:
Date: Fri, 20 Apr 2012 11:42:05 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2
PHP/5.3.6
X-Powered-By: PHP/5.3.6
Content-Length: 12
Connection: close
Content-Type: text/html
<--- empty line
Start printing this
How can you start printing something when you detect a empty line in c or c++?
If you read line by line, just check the length of the line. If the length is zero, then you have an empty line.
If you have to check a memory buffer, then have a counter that is reset to zero on newline. If you reach a newline and the counter already is zero, then you have an empty line.
Edit: Some code how to do this with a memory buffer: