{"id":78,"date":"2006-06-14T22:56:05","date_gmt":"2006-06-14T14:56:05","guid":{"rendered":"http:\/\/www.martinliu.info\/?p=23"},"modified":"2006-06-14T22:56:05","modified_gmt":"2006-06-14T14:56:05","slug":"microsoft-visual-c-2005%e6%94%af%e6%8c%81%e5%8f%af%e5%8f%98%e5%8f%82%e6%95%b0%e5%ae%8f%e4%ba%86","status":"publish","type":"post","link":"https:\/\/www.martinliu.info\/?p=78","title":{"rendered":"Microsoft Visual C++ 2005\u652f\u6301\u53ef\u53d8\u53c2\u6570\u5b8f\u4e86"},"content":{"rendered":"<p>\u597d\u5bb9\u6613\u6709\u65f6\u95f4\u8bd5\u7528\u4e00\u4e0bMicrosoft Visual C++ 2005\uff0c\u7a81\u7136\u60f3\u8d77\u4e4b\u524d\u7279\u522b\u5173\u6ce8\u7684\u4e00\u4e2a\u7279\u6027\u2014\u2014\u53ef\u53d8\u53c2\u6570\u5b8f(Variadic Macros)\uff0c\u4e8e\u662f\u8d76\u7d27\u5199\u4e00\u6bb5\u4ee3\u7801\u8bd5\u8bd5\uff08\u6309\u7167C99\u89c4\u8303\uff09\u3002<\/p>\n<p><span style=\"color: #0000ff;\">#define<\/span> ERROR(fmt, &#8230;) printf(fmt, __VA_ARGS__)<br \/>\nERROR(<span style=\"color: #ff0000;\">&#8220;Args: %d %d&#8221;<\/span>, 1, 2);<\/p>\n<p>\u679c\u7136\u53ef\u4ee5\u652f\u6301\uff01\u5230Microsoft Visual Studio\u7684\u6587\u6863\u4e2d\u67e5\u770b\u65b0\u589e\u7279\u6027\u7684\u4ecb\u7ecd\uff0c\u7684\u786e\u662f\u5b9e\u73b0\u4e86\uff0c\u770b\u6765Visual C++\u7684\u53ef\u79fb\u690d\u517c\u5bb9\u6027\u53c8\u63d0\u9ad8\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u597d\u5bb9\u6613\u6709\u65f6\u95f4\u8bd5\u7528\u4e00\u4e0bMicrosoft Visual C++ 2005\uff0c\u7a81\u7136\u60f3\u8d77\u4e4b\u524d\u7279\u522b\u5173\u6ce8\u7684\u4e00\u4e2a\u7279\u6027\u2014\u2014\u53ef\u53d8\u53c2\u6570\u5b8f(Variadic Macros)\uff0c\u4e8e\u662f\u8d76\u7d27\u5199\u4e00\u6bb5\u4ee3\u7801\u8bd5\u8bd5\uff08\u6309\u7167C99\u89c4\u8303\uff09\u3002 #define ERROR(fmt, &#8230;) printf(fmt, __VA_ARGS__) ERROR(&#8220;Args: %d %d&#8221;, 1, 2); \u679c\u7136\u53ef\u4ee5\u652f\u6301\uff01\u5230Microsoft Visual Studio\u7684\u6587\u6863\u4e2d\u67e5\u770b\u65b0\u589e\u7279\u6027\u7684\u4ecb\u7ecd\uff0c\u7684\u786e\u662f\u5b9e\u73b0\u4e86\uff0c\u770b\u6765Visual C++\u7684\u53ef\u79fb\u690d\u517c\u5bb9\u6027\u53c8\u63d0\u9ad8\u4e86\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-23"],"_links":{"self":[{"href":"https:\/\/www.martinliu.info\/index.php?rest_route=\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.martinliu.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.martinliu.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.martinliu.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.martinliu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":0,"href":"https:\/\/www.martinliu.info\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.martinliu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.martinliu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.martinliu.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}