{"id":3315,"date":"2020-07-24T07:27:45","date_gmt":"2020-07-24T07:27:45","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3315"},"modified":"2020-07-24T07:28:05","modified_gmt":"2020-07-24T07:28:05","slug":"printf-2","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/strings\/printf-2","title":{"rendered":"printf"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Adding lots of values to a string<\/h4>\n\n\n\n<p>Define the message<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define MY_SOAP_MESSAGE\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\"&lt;?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\t\t\t\t\t\t\t\\\n\t\"&lt;v:Envelope xmlns:v=\\\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\\\" xmlns:c=\\\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\\\" xmlns:d=\\\"http:\/\/www.w3.org\/2001\/XMLSchema\\\" xmlns:i=\\\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\\\">\"\t\\\n\t  \"&lt;v:Header \/>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\"&lt;v:Body>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\"&lt;%s xmlns=\\\"%s\\\" id=\\\"o0\\\" c:root=\\\"1\\\">\"\t\t\t\t\t\t\\\n\t\t\t\t\"&lt;%s i:type=\\\"d:string\\\">\"\t\t\t\t\t\t\t\t\t\\\n\t\t\t\t\t\"&amp;lt;?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?&amp;gt;\"\t\t\\\n\t\t\t\t\t\"&amp;lt;request name=\\\"%s\\\"&amp;gt;\"\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\"&amp;lt;UserName&amp;gt;%s&amp;lt;\/UserName&amp;gt;\"\t\t\t\t\\\n\t\t\t\t\t\t\"&amp;lt;UserTag&amp;gt;%s&amp;lt;\/UserTag&amp;gt;\"\t\t\t\t\t\\\n\t\t\t\t\t\"&amp;lt;\/request&amp;gt;\"\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\t\"&lt;\/%s>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\"&lt;\/%s>\" \t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\"&lt;\/v:Body>\" \t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\"&lt;\/v:Envelope>\"<\/code><\/pre>\n\n\n\n<p>Set the values within the message<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tchar buf&#91;1024];\n\n\tif (snprintf(buf, 1024, SOAP_MSG_TMPL, my_method, my_urn, my_elem, my_devid, my_user, uid, my_elem, my_method) &lt; 0)\n\t\treturn NULL;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adding lots of values to a string Define the message Set the values within the message<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-3315","post","type-post","status-publish","format-standard","hentry","category-strings"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3315"}],"version-history":[{"count":2,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3315\/revisions"}],"predecessor-version":[{"id":3317,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3315\/revisions\/3317"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}