0
I got a string on sprintf
and I would like to divide it into multiple lines, because it gets big and the code gets messy.
sprintf(srt,"GET %s HTTP/1.1\r\nAccept: text/javascript\r\nUser-Agent: Custom HTTP User Agent\r\nHost: %s\r\nConnection: Close\r\n\r\n, url, host);
How could I split this into multiple lines making the code more organized?
For example:
GET %s HTTP/1.1\r\n
Accept: text/javascript\r\n
User-Agent: Custom HTTP User Agent\r\n
Host: %s\r\n
Connection: Close\r\n
\r\n
When the constant needs to be higher, you need to know the compiler’s limits. C Standard imposes a minimum limit of 509 characters on C89. In C99 and C11 this limit was increased to 4095 characters.
– pmg