{"id":1739,"date":"2014-01-17T12:19:28","date_gmt":"2014-01-17T12:19:28","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=1739"},"modified":"2014-01-17T12:19:28","modified_gmt":"2014-01-17T12:19:28","slug":"variable-length-string-in-c","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=1739","title":{"rendered":"Variable Length String in C"},"content":{"rendered":"<p>There is no need to construct a special format string.<br \/>\nprintf allows you to specify the precision using a parameter (that precedes the value)<br \/>\nif you use a .* as the precision in the format tag.<\/p>\n<p>For example:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nprintf (&quot;%d %.*s&quot;, number, SIZE, letters);\r\n<\/pre>\n<h4>stackoverflow<\/h4>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/5932214\/printf-string-variable-length-item\">printf string, variable length item<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is no need to construct a special format string. printf allows you to specify the precision using a parameter (that precedes the value) if you use a .* as the precision in the format tag. For example: printf (&quot;%d %.*s&quot;, number, SIZE, letters); stackoverflow printf string, variable length item<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1739","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1739"}],"version-history":[{"count":1,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1739\/revisions"}],"predecessor-version":[{"id":1740,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/1739\/revisions\/1740"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}